Make WordPress Core


Ignore:
Timestamp:
09/04/2013 08:55:05 PM (11 years ago)
Author:
wonderboymusic
Message:

Allow get_pages() to accept an array for the arg parent. Adds unit tests, some will fail until the next commit.

Fixes #9470.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r25234 r25244  
    37363736    }
    37373737
    3738     if ( $parent >= 0 )
     3738    if ( is_array( $parent ) ) {
     3739        $post_parent__in = implode( ',', array_map( 'absint', (array) $parent ) );
     3740        if ( ! empty( $post_parent__in ) )
     3741            $where .= " AND post_parent IN ($post_parent__in)";
     3742    } elseif ( $parent >= 0 ) {
    37393743        $where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
     3744    }
    37403745
    37413746    if ( 1 == count( $post_status ) ) {
Note: See TracChangeset for help on using the changeset viewer.