posts_search
Filters the search SQL that is used in the WHERE clause of WP_Query.
Usage
add_filter( 'posts_search', 'wp_kama_posts_search_filter' ); /** * Function for `posts_search` filter-hook. * * @param string $search Search SQL for WHERE clause. * * @return string */ function wp_kama_posts_search_filter( $search ){ // filter... return $search; }
- $search(string)
- Search SQL for WHERE clause.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
posts_search
wp-includes/class-wp-query.php 2239
$search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );