Index: src/wp-includes/ms-functions.php
===================================================================
--- src/wp-includes/ms-functions.php	(revision 25420)
+++ src/wp-includes/ms-functions.php	(working copy)
@@ -1987,3 +1987,72 @@
 	$count = get_blog_count();
 	return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
 }
+
+/**
+ * Return an array of sites on the specified network. If no network is specified,
+ * return all sites, regardless of network.
+ *
+ * @since 3.7.0
+ *
+ * @param array $args {
+ *     Array of arguments. Optional.
+ *
+ *     @type int|array 'network_id' A network ID or array of network IDs. Default null.
+ *     @type int       'public'     Retrieve public or non-public sites. Default null.
+ *     @type int       'archived'   Retrieve archived or non-archived sites. Default null.
+ *     @type int       'mature'     Retrieve mature or non-mature sites. Default null.
+ *     @type int       'spam'       Retrieve spam or non-spam sites. Default null.
+ *     @type int       'deleted'    Retrieve deleted or non-deleted sites. Default null.
+ *     @type int       'limit'      Number of sites to limit the query to. Default 100.
+ * }
+ *
+ * @return array An array of site data
+ */
+function wp_get_sites( $args = array() ) {
+	global $wpdb;
+
+	if ( wp_is_large_network() )
+		return array();
+
+	$defaults = array(
+		'network_id' => null,
+		'public'     => null,
+		'archived'   => null,
+		'mature'     => null,
+		'spam'       => null,
+		'deleted'    => null,
+		'limit'      => 100,
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	$query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";
+
+	if ( isset( $args['network_id'] ) && ( is_array( $args['network_id'] ) || is_numeric( $args['network_id'] ) ) ) {
+		$network_ids = array_map('intval', (array) $args['network_id'] );
+		$network_ids = implode( ',', $network_ids );
+		$query .= "AND site_id IN ($network_ids) ";
+	}
+
+	if ( isset( $args['public'] ) )
+		$query .= $wpdb->prepare( "AND public = %d ", $args['public'] );
+
+	if ( isset( $args['archived'] ) )
+		$query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] );
+
+	if ( isset( $args['mature'] ) )
+		$query .= $wpdb->prepare( "AND mature = %d ", $args['mature'] );
+
+	if ( isset( $args['spam'] ) )
+		$query .= $wpdb->prepare( "AND spam = %d ", $args['spam'] );
+
+	if ( isset( $args['deleted'] ) )
+		$query .= $wpdb->prepare( "AND deleted = %d ", $args['deleted'] );
+
+	if ( isset( $args['limit'] ) )
+		$query .= $wpdb->prepare( "LIMIT %d ", $args['limit'] );
+
+	$site_results = $wpdb->get_results( $query, ARRAY_A );
+
+	return $site_results;
+}
Index: tests/phpunit/tests/ms.php
===================================================================
--- tests/phpunit/tests/ms.php	(revision 25420)
+++ tests/phpunit/tests/ms.php	(working copy)
@@ -1029,6 +1029,32 @@
 		$this->assertFalse( is_user_spammy( 'testuser1' ) );
 	}
 
+	function test_wp_get_sites() {
+		// Expect no sites (empty array) when passed an invalid network_id
+		$this->assertEquals( array(),  wp_get_sites( array( 'network_id' => 0 ) ) );
+
+		// Expect 1 site when no network_id is specified
+		$this->assertEquals( 1, count( wp_get_sites() ) );
+
+		// Expect 1 site with a network_id of 1
+		$this->assertEquals( 1, count( wp_get_sites( array( 'network_id' => 1 ) ) ) );
+
+		// Expect 1 site when public is null, as it does not modify the query
+		$this->assertEquals( 1, count( wp_get_sites( array( 'network_id' => 1, 'public' => null ) ) ) );
+
+		// Expect 1 site when public is 1, as we have not set any sites to private
+		$this->assertEquals( 1, count( wp_get_sites( array( 'network_id' => 1, 'public' => 1 ) ) ) );
+
+		// Expect no sites (empty array) when public is set to 0
+		$this->assertEquals( array(),  wp_get_sites( array( 'network_id' => 1, 'public' => 0 ) ) );
+
+		// Set the only site in the database to private
+		update_blog_status( 1, 'public', '0' );
+
+		// Expect 1 site when public is 0
+		$this->assertEquals( 1, count( wp_get_sites( array( 'network_id' => 1, 'public' => 0 ) ) ) );
+	}
+
 }
 
 endif;
