WP_Site_Query::query( string|array $query ): WP_Site[]|int[]|int

In this article

Sets up the WordPress query for retrieving sites.

Parameters

$querystring|arrayrequired
Array or URL query string of parameters.

Return

WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids', or the number of sites when 'count' is passed as a query var.

Source

public function query( $query ) {
	$this->query_vars = wp_parse_args( $query );

	return $this->get_sites();
}

Changelog

VersionDescription
4.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.