mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
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:
parent
27a75e12ad
commit
d87a375483
@ -2032,8 +2032,7 @@ function wp_get_sites( $args = array() ) {
|
|||||||
$query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";
|
$query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";
|
||||||
|
|
||||||
if ( isset( $args['network_id'] ) && ( is_array( $args['network_id'] ) || is_numeric( $args['network_id'] ) ) ) {
|
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( ',', wp_parse_id_list( $args['network_id'] ) );
|
||||||
$network_ids = implode( ',', $network_ids );
|
|
||||||
$query .= "AND site_id IN ($network_ids) ";
|
$query .= "AND site_id IN ($network_ids) ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user