Move Parent, Template, and Order to the side
git-svn-id: http://svn.automattic.com/wordpress/trunk@9450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bb51d1ccdc
commit
0018370f9d
|
@ -218,6 +218,57 @@ function page_password_meta_box($post){
|
|||
}
|
||||
add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display page parent form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_parent_meta_box($post){
|
||||
?>
|
||||
<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)'))); ?>
|
||||
<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
|
||||
}
|
||||
add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'side', 'core');
|
||||
|
||||
if ( 0 != count( get_page_templates() ) ) {
|
||||
/**
|
||||
* Display page template form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_template_meta_box($post){
|
||||
?>
|
||||
<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'side', 'core');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display page order form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_order_meta_box($post){
|
||||
?>
|
||||
<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
|
||||
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display custom field for page form fields.
|
||||
*
|
||||
|
@ -278,58 +329,6 @@ function page_slug_meta_box($post){
|
|||
}
|
||||
add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display page parent form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_parent_meta_box($post){
|
||||
?>
|
||||
<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)'))); ?>
|
||||
<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
|
||||
}
|
||||
add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
if ( 0 != count( get_page_templates() ) ) {
|
||||
/**
|
||||
* Display page template form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_template_meta_box($post){
|
||||
?>
|
||||
<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'normal', 'core');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display page order form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_order_meta_box($post){
|
||||
?>
|
||||
<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
|
||||
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
|
|
Loading…
Reference in New Issue