Ticket #9153: 9153.4.patch
File 9153.4.patch, 1.4 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
2201 2201 2202 2202 $exclusions = ''; 2203 2203 if ( !empty($exclude) ) { 2204 $expages = preg_split('/[\s,]+/',$exclude);2204 $expages = array_map('intval', explode(',', $exclude)); 2205 2205 if ( count($expages) ) { 2206 2206 foreach ( $expages as $expage ) { 2207 2207 if (empty($exclusions)) … … 2210 2210 $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage); 2211 2211 } 2212 2212 } 2213 if (!empty($exclusions)) 2214 $exclusions .= ')'; 2213 2215 } 2214 if (!empty($exclusions))2215 $exclusions .= ')';2216 2216 2217 2217 $author_query = ''; 2218 2218 if (!empty($authors)) { … … 2276 2276 $pages = & get_page_children($child_of, $pages); 2277 2277 2278 2278 if ( !empty($exclude_tree) ) { 2279 $exclude = array(); 2280 2281 $exclude = (int) $exclude_tree; 2282 $children = get_page_children($exclude, $pages); 2283 $excludes = array(); 2284 foreach ( $children as $child ) 2285 $excludes[] = $child->ID; 2286 $excludes[] = $exclude; 2279 $excludes = array_map('intval', explode(',', $exclude_tree)); 2280 2281 // exclude tree will work as describben - self and direct childs only (!) 2287 2282 $total = count($pages); 2288 2283 for ( $i = 0; $i < $total; $i++ ) { 2289 if ( in_array($pages[$i]->ID, $excludes) ) 2284 if ( in_array($pages[$i]->ID, $excludes) || 2285 in_array($pages[$i]->post_parent, $excludes)) 2290 2286 unset($pages[$i]); 2291 2287 } 2292 2288 }