diff -r -u wordpress-3.2.1/wp-includes/post.php wordpress/wp-includes/post.php
old
|
new
|
|
3331 | 3331 | 'sort_column' => 'post_title', 'hierarchical' => 1, |
3332 | 3332 | 'exclude' => array(), 'include' => array(), |
3333 | 3333 | 'meta_key' => '', 'meta_value' => '', |
3334 | | 'authors' => '', 'parent' => -1, 'exclude_tree' => '', |
| 3334 | 'authors' => '', 'parent' => -1, 'exclude_tree' => array(), |
3335 | 3335 | 'number' => '', 'offset' => 0, |
3336 | 3336 | 'post_type' => 'page', 'post_status' => 'publish', |
3337 | 3337 | ); |
… |
… |
|
3515 | 3515 | $pages = & get_page_children($child_of, $pages); |
3516 | 3516 | |
3517 | 3517 | if ( !empty($exclude_tree) ) { |
3518 | | $exclude = (int) $exclude_tree; |
3519 | | $children = get_page_children($exclude, $pages); |
3520 | | $excludes = array(); |
3521 | | foreach ( $children as $child ) |
3522 | | $excludes[] = $child->ID; |
3523 | | $excludes[] = $exclude; |
| 3518 | $exclude = preg_split('/[\s,]+/',$exclude_tree); |
| 3519 | foreach( $exclude as $id ) // Remember: works on a COPY |
| 3520 | { |
| 3521 | $children = get_page_children($id, $pages); |
| 3522 | foreach ( $children as $child ) |
| 3523 | $exclude[] = $child->ID; |
| 3524 | } |
3524 | 3525 | $num_pages = count($pages); |
3525 | 3526 | for ( $i = 0; $i < $num_pages; $i++ ) { |
3526 | | if ( in_array($pages[$i]->ID, $excludes) ) |
| 3527 | if ( in_array($pages[$i]->ID, $exclude) ) |
3527 | 3528 | unset($pages[$i]); |
3528 | 3529 | } |
3529 | 3530 | } |