Changeset 54637 for trunk/src/wp-includes/class-wp-network-query.php
- Timestamp:
- 10/18/2022 06:14:01 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-network-query.php
r54133 r54637 87 87 * 88 88 * @since 4.6.0 89 * @since 6.1.0 Introduced the 'update_network_meta_cache' parameter.90 89 * 91 90 * @param string|array $query { 92 91 * Optional. Array or query string of network query parameters. Default empty. 93 92 * 94 * @type int[] $network__in Array of network IDs to include. Default empty. 95 * @type int[] $network__not_in Array of network IDs to exclude. Default empty. 96 * @type bool $count Whether to return a network count (true) or array of network objects. 97 * Default false. 98 * @type string $fields Network fields to return. Accepts 'ids' (returns an array of network IDs) 99 * or empty (returns an array of complete network objects). Default empty. 100 * @type int $number Maximum number of networks to retrieve. Default empty (no limit). 101 * @type int $offset Number of networks to offset the query. Used to build LIMIT clause. 102 * Default 0. 103 * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true. 104 * @type string|array $orderby Network status or array of statuses. Accepts 'id', 'domain', 'path', 105 * 'domain_length', 'path_length' and 'network__in'. Also accepts false, 106 * an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'. 107 * @type string $order How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'. 108 * @type string $domain Limit results to those affiliated with a given domain. Default empty. 109 * @type string[] $domain__in Array of domains to include affiliated networks for. Default empty. 110 * @type string[] $domain__not_in Array of domains to exclude affiliated networks for. Default empty. 111 * @type string $path Limit results to those affiliated with a given path. Default empty. 112 * @type string[] $path__in Array of paths to include affiliated networks for. Default empty. 113 * @type string[] $path__not_in Array of paths to exclude affiliated networks for. Default empty. 114 * @type string $search Search term(s) to retrieve matching networks for. Default empty. 115 * @type bool $update_network_cache Whether to prime the cache for found networks. Default true. 116 * @type bool $update_network_meta_cache Whether to prime the metadata (option) cache for found networks. 117 * Default true. 93 * @type int[] $network__in Array of network IDs to include. Default empty. 94 * @type int[] $network__not_in Array of network IDs to exclude. Default empty. 95 * @type bool $count Whether to return a network count (true) or array of network objects. 96 * Default false. 97 * @type string $fields Network fields to return. Accepts 'ids' (returns an array of network IDs) 98 * or empty (returns an array of complete network objects). Default empty. 99 * @type int $number Maximum number of networks to retrieve. Default empty (no limit). 100 * @type int $offset Number of networks to offset the query. Used to build LIMIT clause. 101 * Default 0. 102 * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true. 103 * @type string|array $orderby Network status or array of statuses. Accepts 'id', 'domain', 'path', 104 * 'domain_length', 'path_length' and 'network__in'. Also accepts false, 105 * an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'. 106 * @type string $order How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'. 107 * @type string $domain Limit results to those affiliated with a given domain. Default empty. 108 * @type string[] $domain__in Array of domains to include affiliated networks for. Default empty. 109 * @type string[] $domain__not_in Array of domains to exclude affiliated networks for. Default empty. 110 * @type string $path Limit results to those affiliated with a given path. Default empty. 111 * @type string[] $path__in Array of paths to include affiliated networks for. Default empty. 112 * @type string[] $path__not_in Array of paths to exclude affiliated networks for. Default empty. 113 * @type string $search Search term(s) to retrieve matching networks for. Default empty. 114 * @type bool $update_network_cache Whether to prime the cache for found networks. Default true. 118 115 * } 119 116 */ 120 117 public function __construct( $query = '' ) { 121 118 $this->query_var_defaults = array( 122 'network__in' => '', 123 'network__not_in' => '', 124 'count' => false, 125 'fields' => '', 126 'number' => '', 127 'offset' => '', 128 'no_found_rows' => true, 129 'orderby' => 'id', 130 'order' => 'ASC', 131 'domain' => '', 132 'domain__in' => '', 133 'domain__not_in' => '', 134 'path' => '', 135 'path__in' => '', 136 'path__not_in' => '', 137 'search' => '', 138 'update_network_cache' => true, 139 'update_network_meta_cache' => true, 119 'network__in' => '', 120 'network__not_in' => '', 121 'count' => false, 122 'fields' => '', 123 'number' => '', 124 'offset' => '', 125 'no_found_rows' => true, 126 'orderby' => 'id', 127 'order' => 'ASC', 128 'domain' => '', 129 'domain__in' => '', 130 'domain__not_in' => '', 131 'path' => '', 132 'path__in' => '', 133 'path__not_in' => '', 134 'search' => '', 135 'update_network_cache' => true, 140 136 ); 141 137 … … 248 244 $_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ); 249 245 250 // Ignore the se arguments,as the queried result will be the same regardless.251 unset( $_args['fields'], $_args['update_network_cache'] , $_args['update_network_meta_cache']);246 // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless. 247 unset( $_args['fields'], $_args['update_network_cache'] ); 252 248 253 249 $key = md5( serialize( $_args ) ); … … 291 287 292 288 if ( $this->query_vars['update_network_cache'] ) { 293 _prime_network_caches( $network_ids , $this->query_vars['update_network_meta_cache']);289 _prime_network_caches( $network_ids ); 294 290 } 295 291
Note: See TracChangeset
for help on using the changeset viewer.