Changeset 13777
- Timestamp:
- 03/20/2010 02:39:58 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/meta-boxes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/meta-boxes.php
r13776 r13777 14 14 15 15 $post_type = $post->post_type; 16 $post_type_object = get_post_type_object($post_type);16 $post_type_object = get_post_type_object($post_type); 17 17 $type_cap = $post_type_object->capability_type; 18 18 $can_publish = current_user_can("publish_${type_cap}s"); … … 284 284 function post_categories_meta_box( $post, $box ) { 285 285 $defaults = array('taxonomy' => 'category'); 286 if ( !isset($box['args']) || !is_array($box['args']) )287 $args = array();286 if ( !isset($box['args']) || !is_array($box['args']) ) 287 $args = array(); 288 288 else 289 289 $args = $box['args']; 290 extract( wp_parse_args($args, $defaults), EXTR_SKIP );290 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); 291 291 $tax = get_taxonomy($taxonomy); 292 292 293 ?>294 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">295 <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">296 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>297 <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>298 </ul>293 ?> 294 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> 295 <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs"> 296 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li> 297 <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> 298 </ul> 299 299 300 300 <div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;"> … … 310 310 </div> 311 311 312 <?php if ( current_user_can($tax->edit_cap) ) : ?>313 <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">314 <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>315 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">316 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php printf( __( 'Add New %s' ), $tax->singular_label ); ?></label><input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( sprintf( 'New %s Name', $tax->singular_label ) ); ?>" tabindex="3" aria-required="true"/>317 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"><?php printf( __('Parent %s'), $tax->singular_label ); ?>:</label><?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('— Parent %s —'), $tax->singular_label ), 'tab_index' => 3 ) ); ?>318 <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-sumbit" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />319 <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce', false ); ?>320 <span id="<?php echo $taxonomy; ?>-ajax-response"></span>321 </p>322 </div>323 <?php endif; ?>324 </div>325 <?php312 <?php if ( current_user_can($tax->edit_cap) ) : ?> 313 <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children"> 314 <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4> 315 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child"> 316 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php printf( __( 'Add New %s' ), $tax->singular_label ); ?></label><input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( sprintf( 'New %s Name', $tax->singular_label ) ); ?>" tabindex="3" aria-required="true"/> 317 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"><?php printf( __('Parent %s'), $tax->singular_label ); ?>:</label><?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('— Parent %s —'), $tax->singular_label ), 'tab_index' => 3 ) ); ?> 318 <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-sumbit" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" /> 319 <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce', false ); ?> 320 <span id="<?php echo $taxonomy; ?>-ajax-response"></span> 321 </p> 322 </div> 323 <?php endif; ?> 324 </div> 325 <?php 326 326 } 327 327
Note: See TracChangeset
for help on using the changeset viewer.