Make WordPress Core

Changeset 13538


Ignore:
Timestamp:
03/01/2010 09:04:37 PM (15 years ago)
Author:
nacin
Message:

Add some custom taxonomy flags to allow fully customize strings in the taxonomy meta box. see #11838

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r13489 r13538  
    621621    $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
    622622
    623     if ( empty( $tags ) )
    624         die( __('No tags found!') );
     623    if ( empty( $tags ) ) {
     624        $tax = get_taxonomy( $taxonomy );
     625        die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') );
     626    }
    625627
    626628    if ( is_wp_error($tags) )
  • trunk/wp-admin/includes/meta-boxes.php

    r13289 r13538  
    250250    if ( !current_user_can($taxonomy->assign_cap) ) // @todo: Display the terms, do not edit.
    251251        return;
    252     $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
     252    $helps      = isset( $taxonomy->helps      ) ? esc_attr( $taxonomy->helps ) : esc_attr__('Separate tags with commas.');
     253    $help_hint  = isset( $taxonomy->help_hint  ) ? $taxonomy->help_hint         : __('Add new tag');
     254    $help_nojs  = isset( $taxonomy->help_nojs  ) ? $taxonomy->help_nojs         : __('Add or remove tags');
     255    $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud        : __('Choose from the most used tags in %s');
    253256?>
    254257<div class="tagsdiv" id="<?php echo $tax_name; ?>">
    255258    <div class="jaxtag">
    256259    <div class="nojs-tags hide-if-js">
    257     <p><?php _e('Add or remove tags'); ?></p>
     260    <p><?php echo $help_nojs; ?></p>
    258261    <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
    259262
    260263    <div class="ajaxtag hide-if-no-js">
    261264        <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
    262         <div class="taghint"><?php _e('Add new tag'); ?></div>
     265        <div class="taghint"><?php echo $help_hint; ?></div>
    263266        <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="" />
    264267        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
     
    267270    <div class="tagchecklist"></div>
    268271</div>
    269 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
     272<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( $help_cloud, $box['title'] ); ?></a></p>
    270273<?php
    271274}
Note: See TracChangeset for help on using the changeset viewer.