Docs: Document the usage of `$wpdb` global in `WP_Query::get_posts()` and `::set_found_posts()`.
Props jontyravi. Fixes #52027. Built from https://develop.svn.wordpress.org/trunk@49792 git-svn-id: http://core.svn.wordpress.org/trunk@49515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e4066a9af8
commit
43bbbf1176
|
@ -1761,6 +1761,8 @@ class WP_Query {
|
||||||
*
|
*
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*
|
*
|
||||||
|
* @global wpdb $wpdb WordPress database abstraction object.
|
||||||
|
*
|
||||||
* @return WP_Post[]|int[] Array of post objects or post IDs.
|
* @return WP_Post[]|int[] Array of post objects or post IDs.
|
||||||
*/
|
*/
|
||||||
public function get_posts() {
|
public function get_posts() {
|
||||||
|
@ -3230,11 +3232,14 @@ class WP_Query {
|
||||||
*
|
*
|
||||||
* @since 3.5.0
|
* @since 3.5.0
|
||||||
*
|
*
|
||||||
|
* @global wpdb $wpdb WordPress database abstraction object.
|
||||||
|
*
|
||||||
* @param array $q Query variables.
|
* @param array $q Query variables.
|
||||||
* @param string $limits LIMIT clauses of the query.
|
* @param string $limits LIMIT clauses of the query.
|
||||||
*/
|
*/
|
||||||
private function set_found_posts( $q, $limits ) {
|
private function set_found_posts( $q, $limits ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
// Bail if posts is an empty array. Continue if posts is an empty string,
|
// Bail if posts is an empty array. Continue if posts is an empty string,
|
||||||
// null, or false to accommodate caching plugins that fill posts later.
|
// null, or false to accommodate caching plugins that fill posts later.
|
||||||
if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {
|
if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-alpha-49791';
|
$wp_version = '5.7-alpha-49792';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue