From 548d8c2e0db2ae3184573f982180b5424ac87345 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 18 Oct 2017 17:39:46 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@41912 git-svn-id: http://core.svn.wordpress.org/trunk@41746 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-site-query.php | 6 ++++-- wp-includes/ms-blogs.php | 3 ++- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-site-query.php b/wp-includes/class-wp-site-query.php index 6f3de914ae..cf2134d8a4 100644 --- a/wp-includes/class-wp-site-query.php +++ b/wp-includes/class-wp-site-query.php @@ -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(); diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index ab98d6e5cb..842d55fa3e 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -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(); diff --git a/wp-includes/version.php b/wp-includes/version.php index fc9f86a754..e87e6fa7a5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-beta2-41911'; +$wp_version = '4.9-beta2-41912'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.