WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 224 | * @since 5.2.0 |
| 225 | * @since 5.6.0 The returned array of network data is assigned to the `networks` property |
| 226 | * of the current WP_Network_Query instance. |
| 227 | * |
| 228 | * @param array|int|null $network_data Return an array of network data to short-circuit WP's network query, |
| 229 | * the network count as an integer if `$this->query_vars['count']` is set, |
| 230 | * or null to allow WP to run its normal queries. |
| 231 | * @param WP_Network_Query $query The WP_Network_Query instance, passed by reference. |
| 232 | */ |
| 233 | $network_data = apply_filters_ref_array( 'networks_pre_query', array( $network_data, &$this ) ); |
| 234 | |
| 235 | if ( null !== $network_data ) { |
| 236 | if ( is_array( $network_data ) && ! $this->query_vars['count'] ) { |
| 237 | $this->networks = $network_data; |
| 238 | } |
| 239 | |
| 240 | return $network_data; |
| 241 | } |
| 242 | |