wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



get_main_site_id › WordPress Function

Desde4.9.0
Obsoleton/a
get_main_site_id ( $network_id = null )
Parâmetros:
  • (int) $network_id Optional. The ID of the network for which to get the main site. Defaults to the current network.
    Required: No
    Padrão: null
Retorna:
  • (int) The ID of the main site.
Definido em:
Codex:

Gets the main site ID.



Fonte

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;
}