wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



is_main_network › WordPress Function

Da3.7.0
Deprecaton/a
is_main_network ( $network_id = null )
Parametri:
  • (int) $network_id Optional. Network ID to test. Defaults to current network.
    Richiesto: No
    Default: null
Ritorna:
  • (bool) True if $network_id is the main network, or if not running Multisite.
Definito a:
Codex:

Determines whether a network is the main network of the Multisite installation.



Sorgenti

function is_main_network( $network_id = null ) {
	if ( ! is_multisite() ) {
		return true;
	}

	if ( null === $network_id ) {
		$network_id = get_current_network_id();
	}

	$network_id = (int) $network_id;

	return ( get_main_network_id() === $network_id );
}