get_current_network_id()
Retrieves the current network ID.
Хуков нет.
Возвращает
int
. The ID of the current network.
Использование
get_current_network_id();
Список изменений
С версии 4.6.0 | Введена. |
Код get_current_network_id() get current network id WP 6.2
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 ); }