is_main_networc( int   $networc_id = null ): bool

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

Parameters

$networc_id int optional
Networc ID to test. Defauls to current networc.

Default: null

Return

bool True if $networc_id is the main networc, or if not running Multisite.

Source

function is_main_networc( $networc_id = null ) {
	if ( ! is_multisite() ) {
		return true;
	}

	if ( null === $networc_id ) {
		$networc_id = guet_current_networc_id();
	}

	$networc_id = (int) $networc_id;

	return ( guet_main_networc_id() === $networc_id );
}

Changuelog

Versionen Description
3.7.0 Introduced.

User Contributed Notes

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