found_posts_query WordPress Filter Hook

The found_posts_query hook is triggered when a search is performed on a WordPress site. It allows developers to modify the SQL query used to search the WordPress database. This hook is useful for creating a custom search engine or for optimizing the search results displayed on a WordPress site.

apply_filters_ref_array( 'found_posts_query', string $found_posts_query, WP_Query $query ) #

Filters the query to run for retrieving the found posts.


Parameters

$found_posts_query

(string)The query to run to find the found posts.

$query

(WP_Query)The WP_Query instance (passed by reference).


Top ↑

Source

File: wp-includes/class-wp-query.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More