pre_get_sites
Fires before sites are retrieved.
Usage
add_action( 'pre_get_sites', 'wp_kama_pre_get_sites_action' ); /** * Function for `pre_get_sites` action-hook. * * @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference). * * @return void */ function wp_kama_pre_get_sites_action( $query ){ // action... }
- $query(WP_Site_Query)
- Current instance of WP_Site_Query (passed by reference).
Changelog
Since 4.6.0 | Introduced. |
Where the hook is called
wp-includes/class-wp-site-query.php 301
do_action_ref_array( 'pre_get_sites', array( &$this ) );