Taxonomy: Introduce a `back_to_items` taxonomy label.

This is used after updating a taxonomy term in the link to return to the term listing screen.

Props benoitchantre

Fixes #41898


git-svn-id: https://develop.svn.wordpress.org/trunk@41618 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-09-27 14:38:40 +00:00
parent 301ecdabe4
commit e5e17a4eff
2 changed files with 5 additions and 3 deletions

View File

@ -75,8 +75,7 @@ do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
<p><strong><?php echo $message; ?></strong></p> <p><strong><?php echo $message; ?></strong></p>
<?php if ( $wp_http_referer ) { ?> <?php if ( $wp_http_referer ) { ?>
<p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"><?php <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"><?php
/* translators: %s: taxonomy name */ echo esc_html( $tax->labels->back_to_items );
printf( _x( '&larr; Back to %s', 'admin screen' ), $tax->labels->name );
?></a></p> ?></a></p>
<?php } ?> <?php } ?>
</div> </div>

View File

@ -120,6 +120,7 @@ function create_initial_taxonomies() {
'separate_items_with_commas' => null, 'separate_items_with_commas' => null,
'add_or_remove_items' => null, 'add_or_remove_items' => null,
'choose_from_most_used' => null, 'choose_from_most_used' => null,
'back_to_items' => __( '&larr; Back to Link Categories' ),
), ),
'capabilities' => array( 'capabilities' => array(
'manage_terms' => 'manage_links', 'manage_terms' => 'manage_links',
@ -452,7 +453,7 @@ function unregister_taxonomy( $taxonomy ) {
* @since 3.0.0 * @since 3.0.0
* @since 4.3.0 Added the `no_terms` label. * @since 4.3.0 Added the `no_terms` label.
* @since 4.4.0 Added the `items_list_navigation` and `items_list` labels. * @since 4.4.0 Added the `items_list_navigation` and `items_list` labels.
* @since 4.9.0 Added the `most_used` label. * @since 4.9.0 Added the `most_used` and `back_to_items` labels.
* *
* @param WP_Taxonomy $tax Taxonomy object. * @param WP_Taxonomy $tax Taxonomy object.
* @return object { * @return object {
@ -489,6 +490,7 @@ function unregister_taxonomy( $taxonomy ) {
* @type string $items_list Label for the table hidden heading. * @type string $items_list Label for the table hidden heading.
* @type string $most_used Title used for the Most Used panel. Not used for non-hierarchical * @type string $most_used Title used for the Most Used panel. Not used for non-hierarchical
* taxonomies. Default 'Most Used'. * taxonomies. Default 'Most Used'.
* @type string $back_to_items Label displayed after a term has been updated.
* } * }
*/ */
function get_taxonomy_labels( $tax ) { function get_taxonomy_labels( $tax ) {
@ -521,6 +523,7 @@ function get_taxonomy_labels( $tax ) {
'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ), 'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ), 'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
'most_used' => array( null, __( 'Most Used' ) ), 'most_used' => array( null, __( 'Most Used' ) ),
'back_to_items' => array( __( '&larr; Back to Tags' ), __( '&larr; Back to Categories' ) ),
); );
$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];