mirror of
git://develop.git.wordpress.org/
synced 2025-03-14 17:09:47 +01:00
Hide Parent dropdown in Page-attributes metabox when no potential parents exist. Props sorich87. Fixes #12655
git-svn-id: https://develop.svn.wordpress.org/trunk@14232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b4051fba69
commit
cbfbe11ce8
@ -519,12 +519,15 @@ function post_revisions_meta_box($post) {
|
||||
function page_attributes_meta_box($post) {
|
||||
$post_type_object = get_post_type_object($post->post_type);
|
||||
if ( $post_type_object->hierarchical ) {
|
||||
$pages = wp_dropdown_pages(array('post_type' => $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', 'echo' => 0));
|
||||
if ( ! empty($pages) ) {
|
||||
?>
|
||||
<h5><?php _e('Parent') ?></h5>
|
||||
<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
|
||||
<?php wp_dropdown_pages(array('post_type' => $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')); ?>
|
||||
<?php echo $pages; ?>
|
||||
<p><?php _e('You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
|
||||
<?php
|
||||
} // end empty pages check
|
||||
} // end hierarchical check.
|
||||
if ( 0 != count( get_page_templates() ) ) {
|
||||
$template = !empty($post->page_template) ? $post->page_template : false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user