Multisite: Introduce `get_networks()`.

`get_networks()` is a wrapper for `WP_Network_Query`.

Props flixos90.
See #32504.


git-svn-id: https://develop.svn.wordpress.org/trunk@37895 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2016-06-28 21:27:41 +00:00
parent d277dd8ef1
commit d93bc1943c
1 changed files with 15 additions and 0 deletions

View File

@ -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.
*