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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( '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' ) ) {

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); +} +?>

@@ -317,87 +330,21 @@ if ( !empty($_REQUEST['s']) ) endif; ?>
-
+ search_box( $tax->labels->search_items, 'tag' ); ?>
-
- -
- -
-
-
- - -display(); ?> - -
-
- - -
-

- ' . __( '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 ) ) ;?>

-
- - -
-
+
labels->popular_items ) ) { - if ( current_user_can( $tax->cap->edit_terms ) ) - $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'echo' => false, 'link' => 'edit' ) ); - else - $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) ); - - if ( $tag_cloud ) : - ?> -
-

labels->popular_items; ?>

- -
-cap->edit_terms) ) { if ( 'category' == $taxonomy ) { /** @@ -489,7 +436,7 @@ do_action( "{$taxonomy}_term_new_form_tag" ); ); /** - * Filter the taxonomy parent drop-down on the Edit Term page. + * Filters the taxonomy parent drop-down on the Edit Term page. * * @since 3.7.0 * @since 4.2.0 Added `$context` parameter. @@ -593,11 +540,78 @@ if ( 'category' == $taxonomy ) { do_action( "{$taxonomy}_add_form", $taxonomy ); ?>
- +labels->popular_items ) ) { + if ( current_user_can( $tax->cap->edit_terms ) ) { + $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'echo' => false, 'link' => 'edit' ) ); + } else { + $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) ); + } + + if ( $tag_cloud ) : + ?> +
+

labels->popular_items; ?>

+ +
+
+
+
+
+ + + +display(); ?> + +
+ + +
+

+ ' . __( '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 ) ) ;?>

+
+ + +
+
+