mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Docs: Document the usage of $wpdb global in WP_Query::get_posts() and ::set_found_posts().
Props jontyravi. Fixes #52027. git-svn-id: https://develop.svn.wordpress.org/trunk@49792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
24f6120e90
commit
c167a9425c
@ -1761,6 +1761,8 @@ class WP_Query {
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @return WP_Post[]|int[] Array of post objects or post IDs.
|
||||
*/
|
||||
public function get_posts() {
|
||||
@ -3230,11 +3232,14 @@ class WP_Query {
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param array $q Query variables.
|
||||
* @param string $limits LIMIT clauses of the query.
|
||||
*/
|
||||
private function set_found_posts( $q, $limits ) {
|
||||
global $wpdb;
|
||||
|
||||
// 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.
|
||||
if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user