diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index f879233af8..cd7f0690fb 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -512,12 +512,15 @@ function post_revisions_meta_box($post) { * @param object $post */ function page_attributes_meta_box($post) { + $post_type_object = get_post_type_object($post->post_type); + if ( $post_type_object->hierarchical ) { ?>
- $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?> + $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>

page_template) ? $post->page_template : false; ?>