Ticket #9153: post.php.diff

File post.php.diff, 1.3 KB (added by tbrams, 4 years ago)

this is a patch for includes/post.php

  • post.php

     
    15281528        // new-style support for all tag-like taxonomies 
    15291529        if ( !empty($tax_input) ) { 
    15301530                foreach ( $tax_input as $taxonomy => $tags ) { 
    1531                         wp_set_post_terms( $post_ID, $tags, $taxonomy );                         
     1531                        wp_set_post_terms( $post_ID, $tags, $taxonomy ); 
    15321532                } 
    15331533        } 
    15341534 
     
    22412241        if ( !empty($exclude_tree) ) { 
    22422242                $exclude = array(); 
    22432243 
    2244                 $exclude = (int) $exclude_tree; 
    2245                 $children = get_page_children($exclude, $pages); 
    2246                 $excludes = array(); 
    2247                 foreach ( $children as $child ) 
    2248                         $excludes[] = $child->ID; 
    2249                 $excludes[] = $exclude; 
    2250                 $total = count($pages); 
    2251                 for ( $i = 0; $i < $total; $i++ ) { 
    2252                         if ( in_array($pages[$i]->ID, $excludes) ) 
    2253                                 unset($pages[$i]); 
    2254                 } 
     2244                $exclude = explode(',',$exclude_tree); 
     2245 
     2246        foreach ($exclude as $exclude_page) { 
     2247                        $children = get_page_children($exclude_page, $pages); 
     2248                        $excludes = array(); 
     2249                        foreach ( $children as $child ) 
     2250                                $excludes[] = $child->ID; 
     2251                        $excludes[] = $exclude_page; 
     2252                        $total = count($pages); 
     2253                        for ( $i = 0; $i < $total; $i++ ) { 
     2254                                if ( in_array($pages[$i]->ID, $excludes) ) 
     2255                                        unset($pages[$i]); 
     2256                        } 
     2257        } 
    22552258        } 
    22562259 
    22572260        $cache[ $key ] = $pages;