pre_get_main_site_id WordPress Filter Hook

The pre_get_main_site_id WordPress hook is used to filter the main site ID before it is retrieved. This can be useful for plugins that need to override the default behavior.

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.


Top ↑

Parameters

$main_site_id

(int|null)If a positive integer is returned, it is interpreted as the main site ID.

$network

(WP_Network)The network object for which the main site was detected.


Top ↑

Source

File: wp-includes/class-wp-network.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.