Use wp_parse_id_list() to parse the 'network_id' parameter in wp_get_sites().

props jamescollins.
see #14511.
Built from https://develop.svn.wordpress.org/trunk@25487


git-svn-id: http://core.svn.wordpress.org/trunk@25408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-09-19 01:20:09 +00:00
parent 27a75e12ad
commit d87a375483

View File

@ -2032,8 +2032,7 @@ function wp_get_sites( $args = array() ) {
$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 );
$network_ids = implode( ',', wp_parse_id_list( $args['network_id'] ) );
$query .= "AND site_id IN ($network_ids) ";
}