wphooks.info - pre_get_sites

pre_get_sites

The hook occurs in the following file:

wp-includes/class-wp-site-query.php:
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
	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.
		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
		$last_changed = wp_cache_get_last_changed( 'sites' );

		$cache_key = "get_sites:$key:$last_changed";
		$cache_value = wp_cache_get( $cache_key, 'sites' );

		if ( false === $cache_value ) {