wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_main_site_id › WordPress Function

Od4.9.0
Przestarzałyn/a
get_main_site_id ( $network_id = null )
Parametry:
  • (int) $network_id Optional. The ID of the network for which to get the main site. Defaults to the current network.
    Wymagane: Nie
    Domyślny: null
Powrót:
  • (int) The ID of the main site.
Zdefiniowane na:
Codex:

Gets the main site ID.



Źródło

function get_main_site_id( $network_id = null ) {
	if ( ! is_multisite() ) {
		return get_current_blog_id();
	}

	$network = get_network( $network_id );
	if ( ! $network ) {
		return 0;
	}

	return $network->site_id;
}