wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_current_network_id › WordPress Function

Depuis4.6.0
Dépréciéen/a
get_current_network_id ( Pas de paramètres )
Retourne:
  • (int) The ID of the current network.
Défini(e) dans:
Codex:

Retrieves the current network ID.



Source

function get_current_network_id() {
	if ( ! is_multisite() ) {
		return 1;
	}

	$current_network = get_network();

	if ( ! isset( $current_network->id ) ) {
		return get_main_network_id();
	}

	return absint( $current_network->id );
}