get_networks()WP 4.6.0

Retrieves a list of networks.

Хуков нет.

Возвращает

Массив|int. List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', or the number of networks when 'count' is passed as a query var.

Использование

get_networks( $args );
$args(строка|массив)
Array or string of arguments. See WP_Network_Query::parse_query() for information on accepted arguments.
По умолчанию: empty array

Список изменений

С версии 4.6.0 Введена.

Код get_networks() WP 6.5.2

function get_networks( $args = array() ) {
	$query = new WP_Network_Query();

	return $query->query( $args );
}