Changeset 10129 for trunk/wp-includes/post.php
- Timestamp:
- 12/08/2008 07:29:42 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r10088 r10129 1418 1418 $post_parent = 0; 1419 1419 1420 if ( !empty($post_ID) ) { 1421 if ( $post_parent == $post_ID ) { 1422 // Post can't be its own parent 1423 $post_parent = 0; 1424 } elseif ( !empty($post_parent) ) { 1425 $parent_post = get_post($post_parent); 1426 // Check for circular dependency 1427 if ( $parent_post->post_parent == $post_ID ) 1428 $post_parent = 0; 1429 } 1430 } 1431 1420 1432 if ( isset($menu_order) ) 1421 1433 $menu_order = (int) $menu_order; … … 2060 2072 'exclude' => '', 'include' => '', 2061 2073 'meta_key' => '', 'meta_value' => '', 2062 'authors' => '', 'parent' => -1 2074 'authors' => '', 'parent' => -1, 'exclude_tree' => '' 2063 2075 ); 2064 2076 … … 2170 2182 if ( $child_of || $hierarchical ) 2171 2183 $pages = & get_page_children($child_of, $pages); 2184 2185 if ( !empty($exclude_tree) ) { 2186 $exclude = array(); 2187 2188 $exclude = (int) $exclude_tree; 2189 $children = get_page_children($exclude, $pages); 2190 $excludes = array(); 2191 foreach ( $children as $child ) 2192 $excludes[] = $child->ID; 2193 $excludes[] = $exclude; 2194 $total = count($pages); 2195 for ( $i = 0; $i < $total; $i++ ) { 2196 if ( in_array($pages[$i]->ID, $excludes) ) 2197 unset($pages[$i]); 2198 } 2199 } 2172 2200 2173 2201 $cache[ $key ] = $pages;
Note: See TracChangeset
for help on using the changeset viewer.