Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r14967 r15190  
    243243 */
    244244function post_tags_meta_box($post, $box) {
    245     $tax_name = esc_attr(substr($box['id'], 8));
    246     $taxonomy = get_taxonomy($tax_name);
    247     $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');
    249     $help_nojs  = isset( $taxonomy->help_nojs  ) ? $taxonomy->help_nojs         : __('Add or remove tags');
    250     $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud        : __('Choose from the most used tags');
    251 
     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);
    252253    $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
    253254?>
     
    255256    <div class="jaxtag">
    256257    <div class="nojs-tags hide-if-js">
    257     <p><?php echo $help_nojs; ?></p>
     258    <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
    258259    <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
    259260    <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    260261    <div class="ajaxtag hide-if-no-js">
    261262        <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>
     263        <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>
    263264        <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="" />
    264265        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p>
    265266    </div>
    266     <p class="howto"><?php echo $helps; ?></p>
     267    <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p>
    267268    <?php endif; ?>
    268269    </div>
     
    270271</div>
    271272<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    272 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $help_cloud; ?></a></p>
     273<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
    273274<?php else : ?>
    274275<p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
Note: See TracChangeset for help on using the changeset viewer.