apply_filters_ref_array( 'posts_search', string $search , WP_Query $query )
Filters the search SQL that is used in the WHERE clause of WP_Query.
Contents
Parameters
More Information
Since version 3.0.0, the posts_search
filter is used to filter the search SQL that is used in the WHERE
clause of WP_Query.
Source
File: wp-includes/class-wp-query.php
.
View all references
$search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example function search by title only:
Top ↑
Feedback
function __search_by_title_only( $search, &$wp_query ) Should be: function __search_by_title_only( $search, $wp_query ) — By nfong —