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.

Built from https://develop.svn.wordpress.org/trunk@41918


git-svn-id: http://core.svn.wordpress.org/trunk@41752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2017-10-18 18:13:50 +00:00
parent 0fc7597032
commit 4cb1026757
3 changed files with 7 additions and 4 deletions

View File

@ -170,7 +170,8 @@ class WP_Network_Query {
* @since 4.6.0 * @since 4.6.0
* *
* @param string|array $query Array or URL query string of parameters. * @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 ) { public function query( $query ) {
$this->query_vars = wp_parse_args( $query ); $this->query_vars = wp_parse_args( $query );
@ -182,7 +183,8 @@ class WP_Network_Query {
* *
* @since 4.6.0 * @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() { public function get_networks() {
$this->parse_query(); $this->parse_query();

View File

@ -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() * @param string|array $args Optional. Array or string of arguments. See WP_Network_Query::parse_query()
* for information on accepted arguments. Default empty array. * 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() ) { function get_networks( $args = array() ) {
$query = new WP_Network_Query(); $query = new WP_Network_Query();

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-beta2-41917'; $wp_version = '4.9-beta2-41918';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.