Changeset 49538 for trunk/src/wp-includes/class-wp-site-query.php
- Timestamp:
- 11/08/2020 11:45:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-site-query.php
r49108 r49538 304 304 * - Otherwise the filter should return an array of WP_Site objects. 305 305 * 306 * Note that if the filter returns an array of site data, it will be assigned 307 * to the `sites` property of the current WP_Site_Query instance. 308 * 309 * Filtering functions that require pagination information are encouraged to set 310 * the `found_sites` and `max_num_pages` properties of the WP_Site_Query object, 311 * passed to the filter by reference. If WP_Site_Query does not perform a database 312 * query, it will not have enough information to generate these values itself. 313 * 306 314 * @since 5.2.0 315 * @since 5.6.0 The returned array of site data is assigned to the `sites` property 316 * of the current WP_Site_Query instance. 307 317 * 308 318 * @param array|int|null $site_data Return an array of site data to short-circuit WP's site query, … … 314 324 315 325 if ( null !== $site_data ) { 326 if ( is_array( $site_data ) && ! $this->query_vars['count'] ) { 327 $this->sites = $site_data; 328 } 329 316 330 return $site_data; 317 331 }
Note: See TracChangeset
for help on using the changeset viewer.