[wp-trac] [WordPress Trac] #43060: register taxonomy should accept a label to affect the description under each field on the Add Tag form

WordPress Trac noreply at wordpress.org
Wed Jan 10 17:27:43 UTC 2018


#43060: register taxonomy should accept a label to affect the description under
each field on the Add Tag form
----------------------------+-----------------------------
 Reporter:  mclaurent       |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Taxonomy        |    Version:  4.9.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Hi

 When registering a custom taxonomy WordPress uses the default UI to allow
 content editors to manage terms in this taxonomy. The descriptions under
 the Tag name and Slug may in some cases not be adequate and/or require
 additionnal guidance.  For instance when the names of tags should follow a
 certain convention or standard.
 For instance for a Countries taxonomy we would wish to give the user
 information on what standard to follow (for instance ISO-3166-2).

 I have attached images of what it currently looks like on the Add Tag
 page, and what it should look like in my opinion.

 Since there are no hooks allowing to add extra information under the tag-
 name field on the edit-tags.php:393, I think the best place for this
 change would be at the time of register_taxonomy. I would suggest
 introducing new labels for a taxonomy which would overwrite the labels
 displayed under each field.


 The implementation would then look something like this:
 {{{#!php
 <?php
 register_taxonomy( 'countries', 'post',array(
         'label' => __( 'Countries' ),
         'labels' => array(
                 'name' => __( 'Countries' ),
                 'singular_name' => __( 'Countries' ),
                 'menu_name' => __( 'Countries' ),
                 'all_items' => __( 'All Countries' ),
                 'edit_item' => __( 'Edit Country' ),
                 'view_item' => __( 'View Country' ),
                 'update_item' => __( 'Update Country' ),
                 'add_new_item' => __( 'Add New Country' ),
                 'new_item_name' => __( 'New Country name' ),
                 // The below would be used on the edit-tags.php:393
                 'new_item_name_description' => __( 'This name should
 adhere to the ISO-3166-2 standard.' ),
                 'parent_item' => __( 'Parent Country' ),
                 'parent_item_colon' => __( 'Parent Country:' ),
                 'search_items' => __( 'Search Countries' ),
                 'popular_items' => __( 'Popular Countries' ),
                 'separate_items_with_commas' => __( 'Separate Countries
 with commas' ),
                 'add_or_remove_items' => __( 'Add or remove Countries' ),
                 'choose_from_most_used' => __( 'Choose from the most used
 Countries' ),
                 'not_found' => __( 'No Countries found' ),
         ),
         'public' => true,
 ));
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43060>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list