From b99a31d35caf79482636affaec8d16fbf5ccbc0b Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 28 Jun 2016 21:28:29 +0000 Subject: [PATCH] Multisite: Introduce `get_networks()`. `get_networks()` is a wrapper for `WP_Network_Query`. Props flixos90. See #32504. Built from https://develop.svn.wordpress.org/trunk@37895 git-svn-id: http://core.svn.wordpress.org/trunk@37836 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-blogs.php | 15 +++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 753c29fd7f..3032f2e031 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -1071,6 +1071,21 @@ function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) { return $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", $wpdb->siteid, $start, $quantity ) , ARRAY_A ); } +/** + * Retrieves a list of networks. + * + * @since 4.6.0 + * + * @param string|array $args Optional. Array or string of arguments. See {@see WP_Network_Query::parse_query()} + * for information on accepted arguments. Default empty. + * @return int|array List of networks or number of found networks if `$count` argument is true. + */ +function get_networks( $args = '' ) { + $query = new WP_Network_Query(); + + return $query->query( $args ); +} + /** * Retrieves network data given a network ID or network object. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 2b675593af..8516052ed3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37894'; +$wp_version = '4.6-alpha-37895'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.