X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..607b7e02d77e7326161e8ec15639052d2040f745:/wp-admin/edit-tags.php diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 6ff9e374..dbb1f483 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -10,21 +10,21 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! $taxnow ) - wp_die( __( 'Invalid taxonomy' ) ); + wp_die( __( 'Invalid taxonomy.' ) ); $tax = get_taxonomy( $taxnow ); if ( ! $tax ) - wp_die( __( 'Invalid taxonomy' ) ); + wp_die( __( 'Invalid taxonomy.' ) ); if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) { - wp_die( __( 'You are not allowed to manage these items.' ) ); + wp_die( __( 'Sorry, you are not allowed to manage these items.' ) ); } if ( ! current_user_can( $tax->cap->manage_terms ) ) { wp_die( '
' . __( 'You are not allowed to manage these items.' ) . '
', + '' . __( 'Sorry, you are not allowed to manage these items.' ) . '
', 403 ); } @@ -71,7 +71,7 @@ case 'add-tag': if ( ! current_user_can( $tax->cap->edit_terms ) ) { wp_die( '' . __( 'You are not allowed to add this item.' ) . '
', + '' . __( 'Sorry, you are not allowed to add this item.' ) . '
', 403 ); } @@ -111,7 +111,7 @@ case 'delete': if ( ! current_user_can( $tax->cap->delete_terms ) ) { wp_die( '' . __( 'You are not allowed to delete this item.' ) . '
', + '' . __( 'Sorry, you are not allowed to delete this item.' ) . '
', 403 ); } @@ -128,7 +128,7 @@ case 'bulk-delete': if ( ! current_user_can( $tax->cap->delete_terms ) ) { wp_die( '' . __( 'You are not allowed to delete these items.' ) . '
', + '' . __( 'Sorry, you are not allowed to delete these items.' ) . '
', 403 ); } @@ -150,17 +150,18 @@ case 'bulk-delete': break; case 'edit': - $title = $tax->labels->edit_item; + if ( ! isset( $_REQUEST['tag_ID'] ) ) { + break; + } - $tag_ID = (int) $_REQUEST['tag_ID']; + $term_id = (int) $_REQUEST['tag_ID']; + $term = get_term( $term_id ); - $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' ); - if ( ! $tag ) + if ( ! $term instanceof WP_Term ) { wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); - include( ABSPATH . 'wp-admin/edit-tag-form.php' ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + } + wp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) ); exit; case 'editedtag': @@ -170,7 +171,7 @@ case 'editedtag': if ( ! current_user_can( $tax->cap->edit_terms ) ) { wp_die( '' . __( 'You are not allowed to edit this item.' ) . '
', + '' . __( 'Sorry, you are not allowed to edit this item.' ) . '
', 403 ); } @@ -204,7 +205,16 @@ if ( $location ) { if ( ! empty( $_REQUEST['paged'] ) ) { $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); } - wp_redirect( $location ); + + /** + * Filters the taxonomy redirect destination URL. + * + * @since 4.6.0 + * + * @param string $location The destination URL. + * @param object $tax The taxonomy object. + */ + wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) ); exit; } @@ -287,7 +297,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); if ( ! current_user_can( $tax->cap->edit_terms ) ) { wp_die( '' . __( 'You are not allowed to edit this item.' ) . '
', + '' . __( 'Sorry, you are not allowed to edit this item.' ) . '
', 403 ); } @@ -307,8 +317,11 @@ if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
- ' . __( 'Note:' ) . '
';
- printf(
- /* translators: %s: default category */
- __( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.' ),
- /** This filter is documented in wp-includes/category-template.php */
- '' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . ''
- );
- ?>
-
category to tag converter.' ), esc_url( $import_link ) ) ?>
- -tag to category converter.' ), esc_url( $import_link ) ) ;?>
-
+ ' . __( 'Note:' ) . '
';
+ printf(
+ /* translators: %s: default category */
+ __( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.' ),
+ /** This filter is documented in wp-includes/category-template.php */
+ '' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . ''
+ );
+ ?>
+
category to tag converter.' ), esc_url( $import_link ) ) ?>
+ +tag to category converter.' ), esc_url( $import_link ) ) ;?>
+