Property changes on: tests/data
___________________________________________________________________
Added: svn:ignore
+ .trac-ticket-cache.unit-tests.trac.wordpress.org
|
|
|
3509 | 3509 | function get_page_children($page_id, $pages) { |
3510 | 3510 | $page_list = array(); |
3511 | 3511 | foreach ( (array) $pages as $page ) { |
3512 | | if ( $page->post_parent == $page_id ) { |
| 3512 | if ( $page->post_parent == $page_id || in_array( $page_id, $page->ancestors ) ) { |
3513 | 3513 | $page_list[] = $page; |
3514 | 3514 | if ( $children = get_page_children($page->ID, $pages) ) |
3515 | 3515 | $page_list = array_merge($page_list, $children); |
… |
… |
|
3795 | 3795 | // Update cache. |
3796 | 3796 | update_post_cache( $pages ); |
3797 | 3797 | |
| 3798 | // Convert to WP_Post instances |
| 3799 | $pages = array_map( 'get_post', $pages ); |
| 3800 | |
3798 | 3801 | if ( $child_of || $hierarchical ) |
3799 | 3802 | $pages = get_page_children($child_of, $pages); |
3800 | 3803 | |
… |
… |
|
3818 | 3821 | |
3819 | 3822 | wp_cache_set( $cache_key, $page_structure, 'posts' ); |
3820 | 3823 | |
3821 | | // Convert to WP_Post instances |
3822 | | $pages = array_map( 'get_post', $pages ); |
3823 | | |
3824 | 3824 | $pages = apply_filters('get_pages', $pages, $r); |
3825 | 3825 | |
3826 | 3826 | return $pages; |