Taxonomy: Change some static strings to registration labels.
Add additional label options to `register_taxonomy()` to allow developers further flexibility for customizing the edit taxonomy screen. Props mclaurent, swissspidy, johnbillion, jeremyescott, theMikeD, jeremyfelt, dontgo2sleep, SergeyBiryukov, audrasjb, Boniu91. Fixes #43060. Built from https://develop.svn.wordpress.org/trunk@52094 git-svn-id: http://core.svn.wordpress.org/trunk@51686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1dac2cdae7
commit
37c02eb5fe
|
@ -146,7 +146,7 @@ if ( isset( $tag->name ) ) {
|
|||
<tr class="form-field form-required term-name-wrap">
|
||||
<th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
|
||||
<p class="description"><?php _e( 'The name is how it appears on your site.' ); ?></p></td>
|
||||
<p class="description"><?php echo $tax->labels->name_description; ?></p></td>
|
||||
</tr>
|
||||
<?php if ( ! global_terms_enabled() ) { ?>
|
||||
<tr class="form-field term-slug-wrap">
|
||||
|
@ -168,7 +168,7 @@ if ( isset( $tag->name ) ) {
|
|||
$slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : '';
|
||||
?>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" />
|
||||
<p class="description"><?php _e( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p></td>
|
||||
<p class="description"><?php echo $tax->labels->slug_description; ?></p></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
|
||||
|
@ -195,7 +195,7 @@ if ( isset( $tag->name ) ) {
|
|||
<?php if ( 'category' === $taxonomy ) : ?>
|
||||
<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>
|
||||
<?php else : ?>
|
||||
<p class="description"><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
|
||||
<p class="description"><?php echo $tax->labels->parent_description; ?></p>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -203,7 +203,7 @@ if ( isset( $tag->name ) ) {
|
|||
<tr class="form-field term-description-wrap">
|
||||
<th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea>
|
||||
<p class="description"><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p></td>
|
||||
<p class="description"><?php echo $tax->labels->description_description; ?></p></td>
|
||||
</tr>
|
||||
<?php
|
||||
// Back compat hooks.
|
||||
|
|
|
@ -454,13 +454,13 @@ if ( $can_edit_terms ) {
|
|||
<div class="form-field form-required term-name-wrap">
|
||||
<label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
|
||||
<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
|
||||
<p><?php _e( 'The name is how it appears on your site.' ); ?></p>
|
||||
<p><?php echo $tax->labels->name_description; ?></p>
|
||||
</div>
|
||||
<?php if ( ! global_terms_enabled() ) : ?>
|
||||
<div class="form-field term-slug-wrap">
|
||||
<label for="tag-slug"><?php _e( 'Slug' ); ?></label>
|
||||
<input name="slug" id="tag-slug" type="text" value="" size="40" />
|
||||
<p><?php _e( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p>
|
||||
<p><?php echo $tax->labels->slug_description; ?></p>
|
||||
</div>
|
||||
<?php endif; // global_terms_enabled() ?>
|
||||
<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
|
||||
|
@ -505,14 +505,14 @@ if ( $can_edit_terms ) {
|
|||
<?php if ( 'category' === $taxonomy ) : ?>
|
||||
<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>
|
||||
<?php else : ?>
|
||||
<p><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
|
||||
<p><?php echo $tax->labels->parent_description; ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; // is_taxonomy_hierarchical() ?>
|
||||
<div class="form-field term-description-wrap">
|
||||
<label for="tag-description"><?php _e( 'Description' ); ?></label>
|
||||
<textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p>
|
||||
<p><?php echo $tax->labels->description_description; ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -646,12 +646,16 @@ function get_taxonomy_labels( $tax ) {
|
|||
|
||||
$nohier_vs_hier_defaults = array(
|
||||
'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
|
||||
'name_description' => array( __( 'The name is how it appears on your site.' ), __( 'The name is how it appears on your site.' ) ),
|
||||
'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
|
||||
'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ),
|
||||
'popular_items' => array( __( 'Popular Tags' ), null ),
|
||||
'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ),
|
||||
'parent_item' => array( null, __( 'Parent Category' ) ),
|
||||
'parent_item_colon' => array( null, __( 'Parent Category:' ) ),
|
||||
'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.' ) ),
|
||||
'slug_description' => array( __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ), __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) ),
|
||||
'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.' ) ),
|
||||
'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ),
|
||||
'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ),
|
||||
'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ),
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52093';
|
||||
$wp_version = '5.9-alpha-52094';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue