posts_search WordPress Filter Hook
The posts_search hook is a great way to add custom search functionality to your Wordpress site. This hook allows you to modify the SQL query that is used to search for posts, giving you full control over the search results. This hook is perfect for adding custom search features to your site, or for tweaking the default search behavior to better suit your needs.
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.
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
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |