WordPress.org

Make WordPress Core

Changeset 9643


Ignore:
Timestamp:
11/12/08 20:20:21 (6 years ago)
Author:
ryan
Message:

Merge page parent, order and template boxes into one box

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r9641 r9643  
    271271 
    272272/** 
    273  * Display page parent form fields. 
    274  * 
    275  * @since 2.6.0 
    276  * 
    277  * @param object $post 
    278  */ 
    279 function page_parent_meta_box($post){ 
    280 ?> 
     273 * Display page attributes form fields. 
     274 * 
     275 * @since 2.7.0 
     276 * 
     277 * @param object $post 
     278 */ 
     279function page_attributes_meta_box($post){ 
     280?> 
     281<h5><?php _e('Parent') ?></h5> 
    281282<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label> 
    282283<?php wp_dropdown_pages(array('selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'))); ?> 
    283284<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> 
    284285<?php 
    285 } 
    286 add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'side', 'core'); 
    287  
    288 if ( 0 != count( get_page_templates() ) ) { 
    289     /** 
    290      * Display page template form fields. 
    291      * 
    292      * @since 2.6.0 
    293      * 
    294      * @param object $post 
    295      */ 
    296     function page_template_meta_box($post){ 
    297 ?> 
     286    if ( 0 != count( get_page_templates() ) ) { 
     287?> 
     288<h5><?php _e('Template') ?></h5> 
    298289<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> 
    299290<option value='default'><?php _e('Default Template'); ?></option> 
     
    303294<?php 
    304295    } 
    305     add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'side', 'core'); 
    306 } 
    307  
    308 /** 
    309  * Display page order form fields. 
    310  * 
    311  * @since 2.6.0 
    312  * 
    313  * @param object $post 
    314  */ 
    315 function page_order_meta_box($post){ 
    316 ?> 
     296?> 
     297<h5><?php _e('Order') ?></h5> 
    317298<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> 
    318299<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&#8217;ll be better in future releases.)'); ?></p> 
    319300<?php 
    320301} 
    321 add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'side', 'core'); 
     302add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core'); 
    322303 
    323304/** 
Note: See TracChangeset for help on using the changeset viewer.