Make WordPress Core

Ticket #6964: meta_boxes.diff

File meta_boxes.diff, 2.8 KB (added by ryan, 16 years ago)
  • wp-admin/includes/template.php

     
    10581058function do_meta_boxes($page, $context, $object) {
    10591059        global $wp_meta_boxes;
    10601060
     1061        do_action('do_meta_boxes', $page, $context, $object);
     1062
    10611063        if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
    10621064                return;
    10631065
     
    10711073        }
    10721074}
    10731075
     1076function remove_meta_box($id, $page, $context) {
     1077        global $wp_meta_boxes;
     1078
     1079        if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) || !isset($wp_meta_boxes[$page][$context][$id]) )
     1080                return;
     1081
     1082        unset($wp_meta_boxes[$page][$context][$id]);
     1083}
     1084
    10741085?>
  • wp-admin/edit-form-advanced.php

     
    225225<?php echo $form_pingback ?>
    226226<?php echo $form_prevstatus ?>
    227227
    228 <div id="tagsdiv" class="postbox <?php echo postbox_classes('tagsdiv', 'post'); ?>">
    229 <h3><?php _e('Tags'); ?></h3>
    230 <div class="inside">
    231 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></p>
     228<?php
     229function post_tags_meta_box($post) {
     230?>
     231<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
    232232<div id="tagchecklist"></div>
    233 </div>
    234 </div>
     233<?php
     234}
     235add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal');
    235236
    236 <div id="categorydiv" class="postbox <?php echo postbox_classes('categorydiv', 'post'); ?>">
    237 <h3><?php _e('Categories') ?></h3>
    238 <div class="inside">
    239 
     237function post_categories_meta_box($post) {
     238?>
    240239<div id="category-adder" class="wp-hidden-children">
    241240        <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
    242241        <p id="category-add" class="wp-hidden-child">
     
    261260
    262261<div id="categories-all" class="ui-tabs-panel">
    263262        <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    264                 <?php wp_category_checklist($post_ID) ?>
     263                <?php wp_category_checklist($post->ID) ?>
    265264        </ul>
    266265</div>
     266<?php
     267}
     268add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal');
     269?>
    267270
    268 </div>
    269 </div>
    270 
    271271<?php do_meta_boxes('post', 'normal', $post); ?>
    272272
    273273<?php do_action('edit_form_advanced'); ?>