Ticket #13357: i18n-for-taxonomies.diff
| File i18n-for-taxonomies.diff, 29.6 KB (added by nbachiyski, 3 years ago) |
|---|
-
wp-includes/taxonomy.php
18 18 register_taxonomy( 'category', 'post', array( 19 19 'hierarchical' => true, 20 20 'update_count_callback' => '_update_post_term_count', 21 'label' => __( 'Categories' ),22 'singular_label' => __( 'Category' ),23 21 'query_var' => false, 24 22 'rewrite' => false, 25 23 'public' => true, … … 30 28 register_taxonomy( 'post_tag', 'post', array( 31 29 'hierarchical' => false, 32 30 'update_count_callback' => '_update_post_term_count', 33 'label' => __( 'Post Tags' ),34 'singular_label' => __( 'Post Tag' ),35 31 'query_var' => false, 36 32 'rewrite' => false, 37 33 'public' => true, … … 41 37 42 38 register_taxonomy( 'nav_menu', 'nav_menu_item', array( 43 39 'hierarchical' => false, 44 'label' => __( 'Navigation Menus' ), 45 'singular_label' => __( 'Navigation Menu' ), 40 'labels' => array( 41 'name' => __( 'Navigation Menus' ), 42 'singular_name' => __( 'Navigation Menu' ), 43 ), 46 44 'query_var' => false, 47 45 'rewrite' => false, 48 46 'show_ui' => false, … … 51 49 52 50 register_taxonomy( 'link_category', 'link', array( 53 51 'hierarchical' => false, 54 'label' => __( 'Categories' ), 52 'labels' => array( 53 'name' => __( 'Categories' ), 54 'singular_name' => __( 'Category' ), 55 ), 55 56 'query_var' => false, 56 57 'rewrite' => false, 57 58 'public' => false, … … 230 231 * 231 232 * show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget; 232 233 * defaults to show_ui which defalts to public. 234 * 235 * labels - An array of labels for this taxonomy. You can see accepted values in {@link get_taxonomy_labels()}. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones. 233 236 * 234 237 * @package WordPress 235 238 * @subpackage Taxonomy … … 254 257 'query_var' => $taxonomy, 255 258 'public' => true, 256 259 'show_ui' => null, 257 'label' => null,258 260 'show_tagcloud' => null, 259 '_builtin' => false 261 '_builtin' => false, 262 'labels' => array(), 260 263 ); 261 264 $args = wp_parse_args($args, $defaults); 262 265 … … 282 285 if ( is_null($args['show_tagcloud']) ) 283 286 $args['show_tagcloud'] = $args['show_ui']; 284 287 285 if ( is_null($args['label'] ) )286 $args['label'] = $taxonomy;287 288 288 foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) { 289 289 if ( empty($args[$cap]) ) 290 290 $args[$cap] = 'manage_categories'; … … 292 292 if ( empty($args['assign_cap']) ) 293 293 $args['assign_cap'] = 'edit_posts'; 294 294 295 if ( empty($args['singular_label']) )296 $args['singular_label'] = $args['label'];297 298 295 $args['name'] = $taxonomy; 299 296 $args['object_type'] = (array) $object_type; 297 $args['labels'] = get_taxonomy_labels( (object) $args ); 298 299 // we keep these two only for backwards compatibility 300 // TODO: remove in 3.1 301 $args['label'] = $args['labels']->name; 302 $args['singular_label'] = $args['labels']->singular_name; 303 300 304 $wp_taxonomies[$taxonomy] = (object) $args; 301 305 302 306 // register callback handling for metabox … … 304 308 } 305 309 306 310 /** 311 * Builds an object with all taxonomy labels out of a taxonomy object 312 * 313 * Accepted keys of the label array in the taxonomy object: 314 * - name - general name for the taxonomy, usually plural. Default is Post Tags/Categories 315 * - singular_name - name for one object of this taxonomy. Default is Post Tag/Category 316 * - search_items - Default is Search Tags/Search Categories 317 * - popular_items - Default is Popular Tags/Popular Categories 318 * - all_items - Default is All Tags/All Categories 319 * - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category 320 * - parent_item_colon - The same as <code>parent_item</code>, but with colon <code>:</code> in the end 321 * - edit_item - Default is Edit Tag/Edit Category 322 * - update_item - Default is Update Tag/Update Category 323 * - add_new_item - Default is Add New Tag/Add New Category 324 * - new_item_name - Default is New Tag Name/New Category Name 325 * 326 * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories.) 327 * 328 * @since 3.0.0 329 * @param object $tax Taxonomy object 330 * @return object object with all the labels as member variables 331 */ 332 333 function get_taxonomy_labels( $tax ) { 334 $nohier_vs_hier_defaults = array( 335 'name' => array( _x( 'Post Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), 336 'singular_name' => array( _x( 'Post Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), 337 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ), 338 'popular_items' => array( __( 'Popular Tags' ), __( 'Popular Category' ) ), 339 'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ), 340 'parent_item' => array( null, __( 'Parent Category' ) ), 341 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), 342 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), 343 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), 344 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), 345 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), 346 ); 347 348 return _get_custom_object_labels( $tax, $nohier_vs_hier_defaults ); 349 } 350 351 /** 307 352 * Add an already registered taxonomy to an object type. 308 353 * 309 354 * @package WordPress … … 2608 2653 2609 2654 return false; 2610 2655 } 2611 2612 2613 ?> -
wp-includes/post.php
40 40 ) ); 41 41 42 42 register_post_type( 'attachment', array( 43 'label' => __( 'Media' ), 43 'labels' => array( 44 'name' => __( 'Media' ), 45 ), 44 46 'public' => true, 45 47 'show_ui' => false, 46 48 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ … … 53 55 ) ); 54 56 55 57 register_post_type( 'revision', array( 56 'label' => __( 'Revisions' ), 57 'singular_label' => __( 'Revision' ), 58 'labels' => array( 59 'name' => __( 'Revisions' ), 60 'singular_name' => __( 'Revision' ), 61 ), 58 62 'public' => false, 59 63 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 60 64 '_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */ … … 65 69 ) ); 66 70 67 71 register_post_type( 'nav_menu_item', array( 68 'label' => __( 'Navigation Menu Items' ), 69 'singular_label' => __( 'Navigation Menu Item' ), 72 'labels' => array( 73 'name' => __( 'Navigation Menu Items' ), 74 'singular_name' => __( 'Navigation Menu Item' ), 75 ), 70 76 'public' => false, 71 77 'show_ui' => false, 72 78 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ … … 907 913 * - search_items - Default is Search Posts/Search Pages 908 914 * - not_found - Default is No posts found/No pages found 909 915 * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash 910 * - parent - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:916 * - parent_item - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page: 911 917 * 912 918 * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.) 913 919 * … … 929 935 'not_found' => array( __('No posts found'), __('No pages found') ), 930 936 'not_found_in_trash' => array( __('No posts found in Trash'), __('No pages found in Trash') ), 931 937 'view' => array( __('View Post'), __('View Page') ), 932 'parent ' => array( null, __('Parent Page:') )938 'parent_item' => array( null, __('Parent Page:') ) 933 939 ); 940 return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); 941 } 942 943 /** 944 * Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object 945 * 946 * @access private 947 */ 948 function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { 934 949 935 950 // try to get missing (singular_)?name from older style (singular_)?label member variables 936 951 // we keep that for backwards compatibility 937 952 // TODO: remove in 3.1 938 if ( !isset( $ post_type_object->labels['name'] ) && isset( $post_type_object->label ) ) {939 $ post_type_object->labels['name'] = $post_type_object->label;953 if ( !isset( $object->labels['name'] ) && isset( $object->label ) ) { 954 $object->labels['name'] = $object->label; 940 955 } 941 if ( !isset( $ post_type_object->labels['singular_name'] ) && isset( $post_type_object->singular_label ) ) {942 $ post_type_object->labels['singular_name'] = $post_type_object->singular_label;956 if ( !isset( $object->labels['singular_name'] ) && isset( $object->singular_label ) ) { 957 $object->labels['singular_name'] = $object->singular_label; 943 958 } 944 959 945 $defaults = array_map( create_function( '$x', $post_type_object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults ); 946 $labels = array_merge( $defaults, $post_type_object->labels ); 947 return (object)$labels; 960 if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) { 961 $object->labels['singular_name'] = $object->labels['name']; 962 } 963 964 $defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults ); 965 $labels = array_merge( $defaults, $object->labels ); 966 return (object)$labels; 948 967 } 949 968 950 969 /** -
wp-includes/default-widgets.php
1001 1001 $title = __('Tags'); 1002 1002 } else { 1003 1003 $tax = get_taxonomy($current_taxonomy); 1004 $title = $tax->label ;1004 $title = $tax->labels->name; 1005 1005 } 1006 1006 } 1007 1007 $title = apply_filters('widget_title', $title, $instance, $this->id_base); … … 1030 1030 <select class="widefat" id="<?php echo $this->get_field_id('taxonomy'); ?>" name="<?php echo $this->get_field_name('taxonomy'); ?>"> 1031 1031 <?php foreach ( get_object_taxonomies('post') as $taxonomy ) : 1032 1032 $tax = get_taxonomy($taxonomy); 1033 if ( !$tax->show_tagcloud || empty($tax->label ) )1033 if ( !$tax->show_tagcloud || empty($tax->labels->name) ) 1034 1034 continue; 1035 1035 ?> 1036 <option value="<?php echo esc_attr($taxonomy) ?>" <?php selected($taxonomy, $current_taxonomy) ?>><?php echo $tax->label ?></option>1036 <option value="<?php echo esc_attr($taxonomy) ?>" <?php selected($taxonomy, $current_taxonomy) ?>><?php echo $tax->labels->name; ?></option> 1037 1037 <?php endforeach; ?> 1038 1038 </select></p><?php 1039 1039 } -
wp-includes/general-template.php
588 588 if ( is_tax() ) { 589 589 $taxonomy = get_query_var( 'taxonomy' ); 590 590 $tax = get_taxonomy( $taxonomy ); 591 $tax = $tax->label;592 591 $term = $wp_query->get_queried_object(); 593 592 $term = $term->name; 594 $title = $tax . $t_sep . $term;593 $title = $tax->labels->name . $t_sep . $term; 595 594 } 596 595 597 596 //If it's a search -
wp-includes/nav-menu.php
518 518 519 519 } elseif ( 'taxonomy' == $menu_item->type ) { 520 520 $object = get_taxonomy( $menu_item->object ); 521 $menu_item->type_label = $object-> singular_label;521 $menu_item->type_label = $object->labels->singular_name; 522 522 $menu_item->url = get_term_link( (int) $menu_item->object_id, $menu_item->object ); 523 523 524 524 $original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' ); … … 566 566 567 567 $object = get_taxonomy( $menu_item->taxonomy ); 568 568 $menu_item->object = $object->name; 569 $menu_item->type_label = $object-> singular_label;569 $menu_item->type_label = $object->labels->singular_name; 570 570 571 571 $menu_item->title = $menu_item->name; 572 572 $menu_item->url = get_term_link( $menu_item, $menu_item->taxonomy ); -
wp-admin/admin-ajax.php
281 281 } 282 282 283 283 ob_start(); 284 wp_dropdown_categories( array( 'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('— Parent %s —'), $taxonomy->singular_label ) ) ); 284 wp_dropdown_categories( array( 285 'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name', 286 'hierarchical' => 1, 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —' 287 ) ); 285 288 $sup = ob_get_contents(); 286 289 ob_end_clean(); 287 290 $add['supplemental'] = array( 'newcat_parent' => $sup ); -
wp-admin/includes/meta-boxes.php
296 296 ?> 297 297 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> 298 298 <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs"> 299 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>299 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li> 300 300 <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> 301 301 </ul> 302 302 … … 320 320 <?php endif; ?> 321 321 <?php if ( current_user_can($tax->edit_cap) ) : ?> 322 322 <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children"> 323 <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> 323 <h4> 324 <a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"> 325 <?php 326 /* translators: %s: add new taxonomy label */ 327 printf( __( '+ %s' ), $tax->labels->add_new_item ); 328 ?> 329 </a> 330 </h4> 324 331 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child"> 325 <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"/> 326 <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 ) ); ?> 327 <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" /> 332 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label> 333 <input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/> 334 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"> 335 <?php echo $tax->labels->parent_item_colon; ?> 336 </label> 337 <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> 338 <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 echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" /> 328 339 <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce', false ); ?> 329 340 <span id="<?php echo $taxonomy; ?>-ajax-response"></span> 330 341 </p> -
wp-admin/includes/template.php
63 63 64 64 <p class="inline-edit-save submit"> 65 65 <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="cancel button-secondary alignleft"><?php _e('Cancel'); ?></a> 66 <?php $update_text = sprintf( __('Update %s'), $tax->singular_label ); ?>66 <?php $update_text = $tax->labels->update_item; ?> 67 67 <a accesskey="s" href="#inline-edit" title="<?php echo esc_attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a> 68 68 <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 69 69 <span class="error" style="display:none;"></span> … … 976 976 977 977 <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?> 978 978 979 <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->label ) ?>979 <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->labels->name) ?> 980 980 <span class="catshow"><?php _e('[more]'); ?></span> 981 981 <span class="cathide" style="display:none;"><?php _e('[less]'); ?></span> 982 982 </span> … … 1040 1040 <?php foreach ( $flat_taxonomies as $taxonomy ) : ?> 1041 1041 1042 1042 <label class="inline-edit-tags"> 1043 <span class="title"><?php echo esc_html($taxonomy->label ) ?></span>1043 <span class="title"><?php echo esc_html($taxonomy->labels->name) ?></span> 1044 1044 <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name)?>]" class="tax_input_<?php echo esc_attr($taxonomy->name)?>"></textarea> 1045 1045 </label> 1046 1046 … … 1566 1566 $attributes = 'class="post-title page-title column-title"' . $style; 1567 1567 $edit_link = get_edit_post_link( $page->ID ); 1568 1568 ?> 1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent . ' ' . esc_html($parent_name) : ''; ?></strong>1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item . ' ' . esc_html($parent_name) : ''; ?></strong> 1570 1570 <?php 1571 1571 $actions = array(); 1572 1572 if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { … … 3762 3762 break; 3763 3763 case 'edit-tags': 3764 3764 global $tax; 3765 $per_page_label = $tax->label ;3765 $per_page_label = $tax->labels->name; 3766 3766 break; 3767 3767 case 'plugins': 3768 3768 $per_page_label = __('Plugins'); -
wp-admin/includes/nav-menu.php
391 391 $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); 392 392 if ( $tax ) { 393 393 $id = $tax->name; 394 add_meta_box( "add-{$id}", $tax->label , 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );394 add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); 395 395 } 396 396 } 397 397 } -
wp-admin/edit-tags.php
19 19 20 20 $tax = get_taxonomy($taxonomy); 21 21 22 $title = $tax->label ;22 $title = $tax->labels->name; 23 23 24 24 if ( empty($post_type) || !in_array( $post_type, get_post_types( array('public' => true) ) ) ) 25 25 $post_type = 'post'; … … 116 116 break; 117 117 118 118 case 'edit': 119 $title = sprintf(_x('Edit %s', '%s: singular taxonomy name'), $tax->singular_label);119 $title = $tax->labels->edit_item; 120 120 121 121 require_once ('admin-header.php'); 122 122 $tag_ID = (int) $_GET['tag_ID']; … … 192 192 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 193 193 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 194 194 <p class="search-box"> 195 <label class="screen-reader-text" for="tag-search-input"><?php printf(_x('Search %s', '%s: plural taxonomy name'), $tax->label); ?>:</label>195 <label class="screen-reader-text" for="tag-search-input"><?php echo $tax->labels->search_items; ?>:</label> 196 196 <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 197 <input type="submit" value="<?php echo esc_attr( sprintf(_x('Search %s', '%s: plural taxonomy name'), $tax->label) );?>" class="button" />197 <input type="submit" value="<?php echo esc_attr( $tax->labels->search_items ); ?>" class="button" /> 198 198 </p> 199 199 </form> 200 200 <br class="clear" /> … … 326 326 if ( $tag_cloud ) : 327 327 ?> 328 328 <div class="tagcloud"> 329 <h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3>329 <h3><?php echo $tax->labels->popular_items; ?></h3> 330 330 <?php echo $tag_cloud; unset( $tag_cloud ); ?> 331 331 </div> 332 332 <?php … … 341 341 ?> 342 342 343 343 <div class="form-wrap"> 344 <h3><?php printf(_x('Add a New %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h3>344 <h3><?php echo $tax->labels->add_new_item; ?></h3> 345 345 <form id="addtag" method="post" action="edit-tags.php" class="validate"> 346 346 <input type="hidden" name="action" value="add-tag" /> 347 347 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> … … 379 379 do_action('add_tag_form_fields', $taxonomy); 380 380 do_action($taxonomy . '_add_form_fields', $taxonomy); 381 381 ?> 382 <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( sprintf(_x('Add %s', '%s: singular taxonomy name'), $tax->singular_label)); ?>" /></p>382 <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /></p> 383 383 <?php 384 384 if ( 'category' == $taxonomy ) 385 385 do_action('edit_category_form', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form -
wp-admin/edit-form-advanced.php
112 112 if ( ! $taxonomy->show_ui ) 113 113 continue; 114 114 115 $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;115 $label = $taxonomy->labels->name; 116 116 117 117 if ( !is_taxonomy_hierarchical($tax_name) ) 118 118 add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core'); -
wp-admin/edit-tag-form.php
24 24 25 25 <div class="wrap"> 26 26 <?php screen_icon(); ?> 27 <h2><?php printf(_x('Edit %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h2>27 <h2><?php echo $tax->labels->edit_item; ?></h2> 28 28 <div id="ajax-response"></div> 29 29 <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"> 30 30 <input type="hidden" name="action" value="editedtag" /> … … 75 75 do_action('edit_tag_form', $tag); 76 76 do_action($taxonomy . '_edit_form', $tag, $taxonomy); 77 77 ?> 78 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( sprintf(_x('Update %s', '%s: singular taxonomy name'), $tax->singular_label)); ?>" /></p>78 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( __( 'Update' ) ); ?>" /></p> 79 79 </form> 80 80 </div> -
wp-admin/menu.php
89 89 if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) ) 90 90 continue; 91 91 92 $submenu['edit.php'][$i++] = array( esc_attr($tax->label ), $tax->manage_cap, 'edit-tags.php?taxonomy=' . $tax->name );92 $submenu['edit.php'][$i++] = array( esc_attr($tax->labels->name), $tax->manage_cap, 'edit-tags.php?taxonomy=' . $tax->name ); 93 93 } 94 94 unset($tax); 95 95 … … 138 138 if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) ) 139 139 continue; 140 140 141 $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label ), $tax->manage_cap, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );141 $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->labels->name), $tax->manage_cap, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" ); 142 142 } 143 143 } 144 144 unset($ptype, $ptype_obj); -
wp-admin/press-this.php
488 488 <div id="taxonomy-category" class="categorydiv"> 489 489 490 490 <ul id="category-tabs" class="category-tabs"> 491 <li class="tabs"><a href="#category-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>491 <li class="tabs"><a href="#category-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li> 492 492 <li class="hide-if-no-js"><a href="#category-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> 493 493 </ul> 494 494 … … 509 509 <?php endif; ?> 510 510 <?php if ( current_user_can($tax->edit_cap) ) : ?> 511 511 <div id="category-adder" class="wp-hidden-children"> 512 <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4> 512 <h4> 513 <a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"> 514 <?php 515 516 printf( __( '+ %s' ), $tax->labels->add_new_item ); 517 ?> 518 </a> 519 </h4> 513 520 <p id="category-add" class="category-add wp-hidden-child"> 514 <label class="screen-reader-text" for="newcategory"><?php printf( __( 'Add New %s' ), $tax->singular_label ); ?></label><input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( sprintf( 'New %s Name', $tax->singular_label ) ); ?>" tabindex="3" aria-required="true"/> 515 <label class="screen-reader-text" for="newcategory_parent"><?php printf( __('Parent %s'), $tax->singular_label ); ?>:</label><?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('— Parent %s —'), $tax->singular_label ), 'tab_index' => 3 ) ); ?> 516 <input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-sumbit" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" /> 521 <label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label> 522 <input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/> 523 <label class="screen-reader-text" for="newcategory_parent"> 524 <?php echo $tax->labels->parent_item_colon; ?> 525 </label> 526 <?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> 527 <input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-sumbit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" /> 517 528 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?> 518 529 <span id="category-ajax-response"></span> 519 530 </p> -
wp-admin/export.php
101 101 <?php foreach ( get_taxonomies( array( 'show_ui' => true ), 'objects' ) as $tax_obj ) { 102 102 $term_dropdown = wp_dropdown_categories( array( 'taxonomy' => $tax_obj->name, 'hide_if_empty' => true, 'show_option_all' => __( 'All Terms' ), 'name' => 'taxonomy[' . $tax_obj->name . ']', 'id' => 'taxonomy-' . $tax_obj->name, 'class' => '', 'echo' => false ) ); 103 103 if ( $term_dropdown ) 104 echo '<label for="taxonomy-' . $tax_obj->name . '">' . $tax_obj->label . '</label>: ' . $term_dropdown . '<br/>';104 echo '<label for="taxonomy-' . $tax_obj->name . '">' . $tax_obj->labels->name . '</label>: ' . $term_dropdown . '<br/>'; 105 105 } 106 106 ?> 107 107 </td>