From 4124fbfa7c62ab6a5e6b7de929bdf891369f58c7 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Wed, 18 Oct 2017 18:12:20 +0000 Subject: [PATCH] Multisite: Document all return types in get_networks(). Adds more complete documentation to get_networks() and the corresponding methods in WP_Network_Query. Fixes #42260. git-svn-id: https://develop.svn.wordpress.org/trunk@41918 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-network-query.php | 6 ++++-- src/wp-includes/ms-blogs.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-network-query.php b/src/wp-includes/class-wp-network-query.php index f1a46bec3c..f8ca48f452 100644 --- a/src/wp-includes/class-wp-network-query.php +++ b/src/wp-includes/class-wp-network-query.php @@ -170,7 +170,8 @@ class WP_Network_Query { * @since 4.6.0 * * @param string|array $query Array or URL query string of parameters. - * @return array|int List of networks, or number of networks when 'count' is passed as a query var. + * @return array|int List of WP_Network objects, a list of network ids when 'fields' is set to 'ids', + * or the number of networks when 'count' is passed as a query var. */ public function query( $query ) { $this->query_vars = wp_parse_args( $query ); @@ -182,7 +183,8 @@ class WP_Network_Query { * * @since 4.6.0 * - * @return int|array The list of networks. + * @return array|int List of WP_Network objects, a list of network ids when 'fields' is set to 'ids', + * or the number of networks when 'count' is passed as a query var. */ public function get_networks() { $this->parse_query(); diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index 842d55fa3e..3d63bc5743 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/wp-includes/ms-blogs.php @@ -1116,7 +1116,8 @@ function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) { * * @param string|array $args Optional. Array or string of arguments. See WP_Network_Query::parse_query() * for information on accepted arguments. Default empty array. - * @return int|array List of networks or number of found networks if `$count` argument is true. + * @return array|int List of WP_Network objects, a list of network ids when 'fields' is set to 'ids', + * or the number of networks when 'count' is passed as a query var. */ function get_networks( $args = array() ) { $query = new WP_Network_Query();