Ticket #9153: post.php-exclude_tree.patch
File post.php-exclude_tree.patch, 1.2 KB (added by , 11 years ago) |
---|
-
.php
old new 3698 3698 'sort_column' => 'post_title', 'hierarchical' => 1, 3699 3699 'exclude' => array(), 'include' => array(), 3700 3700 'meta_key' => '', 'meta_value' => '', 3701 'authors' => '', 'parent' => -1, 'exclude_tree' => '',3701 'authors' => '', 'parent' => -1, 'exclude_tree' => array(), 3702 3702 'number' => '', 'offset' => 0, 3703 3703 'post_type' => 'page', 'post_status' => 'publish', 3704 3704 ); … … 3881 3881 $pages = get_page_children($child_of, $pages); 3882 3882 3883 3883 if ( !empty($exclude_tree) ) { 3884 $exclude = (int) $exclude_tree; 3885 $children = get_page_children($exclude, $pages); 3886 $excludes = array(); 3887 foreach ( $children as $child ) 3888 $excludes[] = $child->ID; 3889 $excludes[] = $exclude; 3884 $exclude = preg_split('/[\s,]+/',$exclude_tree); 3885 foreach( $exclude as $id ) // Remember: works on a COPY 3886 { 3887 $children = get_page_children($id, $pages); 3888 foreach ( $children as $child ) 3889 $exclude[] = $child->ID; 3890 } 3890 3891 $num_pages = count($pages); 3891 3892 for ( $i = 0; $i < $num_pages; $i++ ) { 3892 if ( in_array($pages[$i]->ID, $exclude s) )3893 if ( in_array($pages[$i]->ID, $exclude) ) 3893 3894 unset($pages[$i]); 3894 3895 } 3895 3896 }