WP_Site_Query::query( string|array $query ): array|int
Sets up the WordPress query for retrieving sites.
Parameters
-
$query
string|array Required -
Array or URL query string of parameters.
Return
array|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
File: wp-includes/class-wp-site-query.php
.
View all references
public function query( $query ) {
$this->query_vars = wp_parse_args( $query );
return $this->get_sites();
}
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |