On this page
apply_filters( 'pre_get_main_site_id', int|null $main_site_id, WP_Network $network )
Filters the main site ID.
Description
Returning a positive integer will effectively short-circuit the function.
Parameters
$main_site_idint|null-
If a positive integer is returned, it is interpreted as the main site ID.
$networkWP_Network-
The network object for which the main site was detected.
Source
File: wp-includes/class-wp-network.php. View all references
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );
Related
Used By
| Used By | Description |
|---|---|
| WP_Network::get_main_site_id() wp-includes/class-wp-network.php | Returns the main site ID for the network. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_get_main_site_id