如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款
get_sites( string|array $args = array() )
Retrieves a list of sites matching requested arguments.
描述
See also #See also
- WP_Site_Query::parse_query()
Top ↑
参数
- $args
(string|array)
(Optional)
Array or query string of site query parameters.
- 'site__in'
(array) Array of site IDs to include. - 'site__not_in'
(array) Array of site IDs to exclude. - 'count'
(bool) Whether to return a site count (true) or array of site objects. Default false. - 'date_query'
(array) Date query clauses to limit sites by. See WP_Date_Query. Default null. - 'fields'
(string) Site fields to return. Accepts 'ids' (returns an array of site IDs) or empty (returns an array of complete site objects). - 'ID'
(int) A site ID to>Default value: array()
返回
(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.