Make WordPress Core

Ticket #43060: 43060.3.diff

File 43060.3.diff, 9.4 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-admin/edit-tag-form.php

     
    146146                <tr class="form-field form-required term-name-wrap">
    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() ) { ?>
    152152                <tr class="form-field term-slug-wrap">
     
    168168                        $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : '';
    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 } ?>
    174174<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
     
    195195                                <?php if ( 'category' === $taxonomy ) : ?>
    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>
    201201                </tr>
     
    203203                <tr class="form-field term-description-wrap">
    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
    209209                // Back compat hooks.
  • src/wp-admin/edit-tags.php

     
    454454<div class="form-field form-required term-name-wrap">
    455455        <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
    456456        <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
    457         <p><?php echo $tax->labels->name_description; ?></p>
     457        <p><?php echo $tax->labels->name_field_description; ?></p>
    458458</div>
    459459        <?php if ( ! global_terms_enabled() ) : ?>
    460460<div class="form-field term-slug-wrap">
    461461        <label for="tag-slug"><?php _e( 'Slug' ); ?></label>
    462462        <input name="slug" id="tag-slug" type="text" value="" size="40" />
    463         <p><?php echo $tax->labels->slug_description; ?></p>
     463        <p><?php echo $tax->labels->slug_field_description; ?></p>
    464464</div>
    465465<?php endif; // global_terms_enabled() ?>
    466466        <?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
     
    505505                <?php if ( 'category' === $taxonomy ) : ?>
    506506                <p><?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>
    507507        <?php else : ?>
    508                 <p><?php echo $tax->labels->parent_description; ?></p>
     508                <p><?php echo $tax->labels->parent_field_description; ?></p>
    509509        <?php endif; ?>
    510510</div>
    511511        <?php endif; // is_taxonomy_hierarchical() ?>
     
    512512<div class="form-field term-description-wrap">
    513513        <label for="tag-description"><?php _e( 'Description' ); ?></label>
    514514        <textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
    515         <p><?php echo $tax->labels->description_description; ?></p>
     515        <p><?php echo $tax->labels->desc_field_description; ?></p>
    516516</div>
    517517
    518518        <?php
  • src/wp-includes/taxonomy.php

     
    589589 * @since 4.9.0 Added the `most_used` and `back_to_items` labels.
    590590 * @since 5.7.0 Added the `filter_by_item` label.
    591591 * @since 5.8.0 Added the `item_link` and `item_link_description` labels.
     592 * @since 5.9.0 Added the `name_field_description`, `slug_field_description`,
     593 *              `parent_field_description`, and `desc_field_description` labels.
    592594 *
    593595 * @param WP_Taxonomy $tax Taxonomy object.
    594596 * @return object {
     
    602604 *     @type string $popular_items              This label is only used for non-hierarchical taxonomies.
    603605 *                                              Default 'Popular Tags'.
    604606 *     @type string $all_items                  Default 'All Tags'/'All Categories'.
     607 *     @type string $name_field_description     Description for the Name field on Edit Tags screen.
     608 *                                              Default 'The name is how it appears on your site'.
     609 *     @type string $slug_field_description     Description for the Slug field on Edit Tags screen.
     610 *                                              Default 'The &#8220;slug&#8221; is the URL-friendly version
     611 *                                              of the name. It is usually all lowercase and contains
     612 *                                              only letters, numbers, and hyphens'.
    605613 *     @type string $parent_item                This label is only used for hierarchical taxonomies. Default
    606614 *                                              'Parent Category'.
    607615 *     @type string $parent_item_colon          The same as `parent_item`, but with colon `:` in the end.
     616 *     @type string $parent_field_description   Description for the Parent field on Edit Tags screen.
     617 *                                              Default 'Assign a parent term to create a hierarchy.
     618 *                                              The term Jazz, for example, would be the parent
     619 *                                              of Bebop and Big Band'.
     620 *     @type string $desc_field_description     Description for the Description field on Edit Tags screen.
     621 *                                              Default 'The description is not prominent by default;
     622 *                                              however, some themes may show it'.
    608623 *     @type string $edit_item                  Default 'Edit Tag'/'Edit Category'.
    609624 *     @type string $view_item                  Default 'View Tag'/'View Category'.
    610625 *     @type string $update_item                Default 'Update Tag'/'Update Category'.
     
    644659                $tax->labels['not_found'] = $tax->no_tagcloud;
    645660        }
    646661
     662        $name_field_description   = __( 'The name is how it appears on your site.' );
     663        $slug_field_description   = __( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' );
     664        $parent_field_description = __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' )
     665        $desc_field_description   = __( 'The description is not prominent by default; however, some themes may show it.' );
     666
    647667        $nohier_vs_hier_defaults = array(
    648668                'name'                       => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
    649                 'name_description'           => array( __( 'The name is how it appears on your site.' ), __( 'The name is how it appears on your site.' ) ),
    650669                'singular_name'              => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
    651670                'search_items'               => array( __( 'Search Tags' ), __( 'Search Categories' ) ),
    652671                'popular_items'              => array( __( 'Popular Tags' ), null ),
    653672                'all_items'                  => array( __( 'All Tags' ), __( 'All Categories' ) ),
     673                'name_field_description'     => array( $name_field_description, $name_field_description ),
     674                'slug_field_description'     => array( $slug_field_description, $slug_field_description );
    654675                'parent_item'                => array( null, __( 'Parent Category' ) ),
    655676                'parent_item_colon'          => array( null, __( 'Parent Category:' ) ),
    656                 'parent_description'         => array( null, __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ) ),
    657                 'slug_description'           => array( __( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ), __( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) ),
    658                 'description_description'    => array( __( 'The description is not prominent by default; however, some themes may show it.' ), __( 'The description is not prominent by default; however, some themes may show it.' ) ),
     677                'parent_field_description'   => array( null, $parent_field_description ),
     678                'desc_field_description'     => array( $desc_field_description, $desc_field_description ),
    659679                'edit_item'                  => array( __( 'Edit Tag' ), __( 'Edit Category' ) ),
    660680                'view_item'                  => array( __( 'View Tag' ), __( 'View Category' ) ),
    661681                'update_item'                => array( __( 'Update Tag' ), __( 'Update Category' ) ),