Core Function
View Source on Trac ↗ is_main_site()
is_main_site( mixed $site_id = null, mixed $network_id = null ) Determines whether a site is the main site of the current network.
Parameters 1 required
| Name / Type | Description |
|---|---|
| $site_id int | Optional. Site ID to test. Defaults to current site. |
| int | $network_id Optional. Network ID of the network to check for. Defaults to current network. Required |
Return Value
(bool)
bool True if $site_id is the main site of the network, or if not
running Multisite.
Function Information
Since Version
3.0.0
Source File
wp-includes/functions.php
Advertisement