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

$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );

Changelog

VersionDescription
4.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.