A WordPress-centric search engine for devs and theme authors



get_sites ›

Since4.6.0
Deprecatedn/a
get_sites ( $args = array() )
Parameters:
  • (string|array) $args { Optional. Array or query string of site query parameters. Default empty.
    Required: No
    Default: array()
See:
  • WP_Site_Query::parse_query()
Returns:
  • (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.
Defined at:
Codex:
Change Log:
  • 4.8.0

Retrieves a list of sites matching requested arguments.



Source

function get_sites( $args = array() ) {
	$query = new WP_Site_Query();

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