diff --git a/src/wp-admin/edit-tag-form.php b/src/wp-admin/edit-tag-form.php index b8d23402cd..ea92a2d16a 100644 --- a/src/wp-admin/edit-tag-form.php +++ b/src/wp-admin/edit-tag-form.php @@ -7,16 +7,8 @@ */ // don't load directly -if ( !defined('ABSPATH') ) - die('-1'); - -if ( empty($tag_ID) ) { ?> -
diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php index 713c8b9472..b953da683a 100644 --- a/src/wp-admin/edit-tags.php +++ b/src/wp-admin/edit-tags.php @@ -150,21 +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': diff --git a/src/wp-admin/term.php b/src/wp-admin/term.php new file mode 100644 index 0000000000..76990f761e --- /dev/null +++ b/src/wp-admin/term.php @@ -0,0 +1,67 @@ + $taxnow ), $sendback ); + } + wp_redirect( esc_url( $sendback ) ); + exit; +} + +$term_id = absint( $_REQUEST['term_id'] ); +$tag = get_term( $term_id, $taxnow, OBJECT, 'edit' ); + +if ( ! $tag instanceof WP_Term ) { + wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); +} + +$tax = get_taxonomy( $tag->taxonomy ); +$taxonomy = $tax->name; +$title = $tax->labels->edit_item; + +if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) || + ! current_user_can( $tax->cap->manage_terms ) +) { + wp_die( + ' |
---|