mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Allow get_pages() to accept an array for the arg parent. Adds unit tests, some will fail until the next commit.
Fixes #9470. git-svn-id: https://develop.svn.wordpress.org/trunk@25244 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3735,8 +3735,13 @@ function get_pages($args = '') {
|
||||
|
||||
}
|
||||
|
||||
if ( $parent >= 0 )
|
||||
if ( is_array( $parent ) ) {
|
||||
$post_parent__in = implode( ',', array_map( 'absint', (array) $parent ) );
|
||||
if ( ! empty( $post_parent__in ) )
|
||||
$where .= " AND post_parent IN ($post_parent__in)";
|
||||
} elseif ( $parent >= 0 ) {
|
||||
$where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
|
||||
}
|
||||
|
||||
if ( 1 == count( $post_status ) ) {
|
||||
$where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $post_type, array_shift( $post_status ) );
|
||||
|
||||
Reference in New Issue
Block a user