Last active
September 29, 2015 21:29
-
-
Save DrewAPicture/c4c067788d6262aa30b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* If hierarchical is false, and child_of is not empty, pages will (apparently) be returned | |
* hierarchically anyway in order of creation: 3, 4, 5. | |
*/ | |
$this->assertEqualSets( array( $page_3, $page_4, $page_5 ), wp_list_pluck( $pages, 'ID' ) ); | |
// How it should work. | |
$found_pages = wp_list_filter( $pages, array( 'post_parent' => $page_1 ) ); | |
$this->assertEqualSets( array( $page_3, $page_5 ), wp_list_pluck( $found_pages, 'ID' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment