Make WordPress Core


Ignore:
Timestamp:
11/15/2021 04:43:29 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Taxonomy: Clarify the taxonomy labels for customizing the field descriptions on Edit Tags screen:

  • Update the label names to make it clear that these descriptions are not for the term name or slug itself, but for the Name, Slug, Parent, and Description fields:
    • name_field_description
    • slug_field_description
    • parent_field_description
    • desc_field_description
  • Update the array structure to make it clear that the default values for these labels are the same for both hierarchical and non-hierarchical taxonomies, with the exception of parent_field_description.
  • Add documentation and a @since note for the new labels.

Follow-up to [52094].

Fixes #43060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tag-form.php

    r52094 r52163  
    147147            <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
    148148            <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
    149             <p class="description"><?php echo $tax->labels->name_description; ?></p></td>
     149            <p class="description"><?php echo $tax->labels->name_field_description; ?></p></td>
    150150        </tr>
    151151<?php if ( ! global_terms_enabled() ) { ?>
     
    169169            ?>
    170170            <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" />
    171             <p class="description"><?php echo $tax->labels->slug_description; ?></p></td>
     171            <p class="description"><?php echo $tax->labels->slug_field_description; ?></p></td>
    172172        </tr>
    173173<?php } ?>
     
    196196                    <p class="description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
    197197                <?php else : ?>
    198                     <p class="description"><?php echo $tax->labels->parent_description; ?></p>
     198                    <p class="description"><?php echo $tax->labels->parent_field_description; ?></p>
    199199                <?php endif; ?>
    200200            </td>
     
    204204            <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th>
    205205            <td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea>
    206             <p class="description"><?php echo $tax->labels->description_description; ?></p></td>
     206            <p class="description"><?php echo $tax->labels->desc_field_description; ?></p></td>
    207207        </tr>
    208208        <?php
Note: See TracChangeset for help on using the changeset viewer.