Make WordPress Core


Ignore:
Timestamp:
06/09/2010 09:59:13 PM (14 years ago)
Author:
ryan
Message:

Pass taxonomy to post_tags_meta_box. Use add_new_item label. see #13805

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r14967 r15183  
    243243 */
    244244function post_tags_meta_box($post, $box) {
    245     $tax_name = esc_attr(substr($box['id'], 8));
    246     $taxonomy = get_taxonomy($tax_name);
     245    $defaults = array('taxonomy' => 'post_tag');
     246    if ( !isset($box['args']) || !is_array($box['args']) )
     247        $args = array();
     248    else
     249        $args = $box['args'];
     250    extract( wp_parse_args($args, $defaults), EXTR_SKIP );
     251    $tax_name = esc_attr($taxonomy);
     252    $taxonomy = get_taxonomy($taxonomy);
     253
    247254    $helps      = isset( $taxonomy->helps      ) ? esc_attr( $taxonomy->helps ) : esc_attr__('Separate tags with commas.');
    248     $help_hint  = isset( $taxonomy->help_hint  ) ? $taxonomy->help_hint         : __('Add new tag');
    249255    $help_nojs  = isset( $taxonomy->help_nojs  ) ? $taxonomy->help_nojs         : __('Add or remove tags');
    250256    $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud        : __('Choose from the most used tags');
     
    260266    <div class="ajaxtag hide-if-no-js">
    261267        <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
    262         <div class="taghint"><?php echo $help_hint; ?></div>
     268        <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>
    263269        <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
    264270        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p>
Note: See TracChangeset for help on using the changeset viewer.