Function: get_main_site_id

get_main_site_id( integer $network_id )

Gets the main site ID.

Parameters

Name Type(s) Default Value Description
$network_id integer null

Optional. The ID of the network for which to get the main site. Defaults to the current network.

Returns

integer

The ID of the main site.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.