Multisite: Document all return types in get_sites()
.
Adds more complete documentation to `get_sites()` and the corresponding methods in `WP_Site_Query`. Fixes #41789. git-svn-id: https://develop.svn.wordpress.org/trunk@41912 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d3df7a6a18
commit
d4bdbbf542
@ -211,7 +211,8 @@ class WP_Site_Query {
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @param string|array $query Array or URL query string of parameters.
|
||||
* @return array|int List of WP_Site objects, or number of sites when 'count' is passed as a query var.
|
||||
* @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.
|
||||
*/
|
||||
public function query( $query ) {
|
||||
$this->query_vars = wp_parse_args( $query );
|
||||
@ -224,7 +225,8 @@ class WP_Site_Query {
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @return array|int List of WP_Site objects, or number of sites when 'count' is passed as a query var.
|
||||
* @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.
|
||||
*/
|
||||
public function get_sites() {
|
||||
$this->parse_query();
|
||||
|
@ -636,7 +636,8 @@ function update_site_cache( $sites ) {
|
||||
* Default empty array.
|
||||
* @type bool $update_site_cache Whether to prime the cache for found sites. Default true.
|
||||
* }
|
||||
* @return array|int List of sites, or number of sites when 'count' is passed as a query var.
|
||||
* @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.
|
||||
*/
|
||||
function get_sites( $args = array() ) {
|
||||
$query = new WP_Site_Query();
|
||||
|
Loading…
x
Reference in New Issue
Block a user