mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-15 01:54:30 +00:00
becae4f49207a291e13ab6c0ec762d8d3b305e50
WP_Query fetch them from the database.
Returning a non-null value from the new `posts_pre_query` filter will cause `WP_Query` to skip its database query, so that posts data can be provided from elsewhere. This is useful in cases where post data may be mirrored in a separate location, such as an external search application. Developers should note that the `WP_Query` properties generally used to calculate pagination - specifically, `found_posts` and `max_num_pages`, which are determined by default in `set_found_posts()` - must be provided explicitly when using the `posts_pre_query` filter; since `WP_Query` will not be contacting the database, it will have no access to `SELECT FOUND_ROWS()`. The `WP_Query` instance is passed to `posts_pre_query` by reference, so that these properties can be set manually if needed. Props jpdavoutian, tlovett1. Fixes #36687. git-svn-id: https://develop.svn.wordpress.org/trunk@37692 602fd350-edb4-49c9-b593-d223f7449a82
Query: Allow plugins to supply post results instead of having
WP_Query fetch them from the database.
Query: Allow plugins to supply post results instead of having
WP_Query fetch them from the database.
Description
No description provided
Languages
PHP
80.5%
CSS
9.4%
JavaScript
8.5%
SCSS
0.9%
HTML
0.7%