Check for circular post parent dependencies. Exclude the current post and its children from the parent dropdown.

git-svn-id: http://svn.automattic.com/wordpress/trunk@10129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-12-08 19:29:42 +00:00
parent fd64845396
commit 504bc044d8
2 changed files with 30 additions and 2 deletions

View File

@@ -270,7 +270,7 @@ function page_attributes_meta_box($post){
?>
<h5><?php _e('Parent') ?></h5>
<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
<?php wp_dropdown_pages(array('selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'))); ?>
<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'))); ?>
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
<?php
if ( 0 != count( get_page_templates() ) ) {