wphooks.info - pre_get_sites

pre_get_sites

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/class-wp-site-query.php:
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
	public function get_sites() {
		$this->parse_query();

		/**
		 * Fires before sites are retrieved.
		 *
		 * @since 4.6.0
		 *
		 * @param WP_Site_Query $this Current instance of WP_Site_Query (passed by reference).
		 */
		do_action_ref_array( 'pre_get_sites', array( &$this ) );

		// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.
		$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );

		// Ignore the $fields argument as the queried result will be the same regardless.
		unset( $_args['fields'] );

		$key = md5( serialize( $_args ) );
		$last_changed = wp_cache_get_last_changed( 'sites' );