wphooks.info - pre_get_networks

pre_get_networks

The hook occurs in the following file:

wp-includes/class-wp-network-query.php:
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
	public function get_networks() {
		$this->parse_query();

		/**
		 * Fires before networks are retrieved.
		 *
		 * @since 4.6.0
		 *
		 * @param WP_Network_Query &$this Current instance of WP_Network_Query, passed by reference.
		 */
		do_action_ref_array( 'pre_get_networks', 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( 'networks' );

		$cache_key = "get_network_ids:$key:$last_changed";
		$cache_value = wp_cache_get( $cache_key, 'networks' );

		if ( false === $cache_value ) {