Make WordPress Core


Ignore:
Timestamp:
01/15/2016 08:26:06 AM (11 years ago)
Author:
swissspidy
Message:

Taxonomy: Introduce wp-admin/term.php for editing single terms.

This is similar to edit.php -> post.php and users.php -> user-edit.php and fixes a bug where screen options for the list table were shown while editing a term.

Fixes #34988.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tags.php

    r36302 r36308  
    151151
    152152case 'edit':
    153         $title = $tax->labels->edit_item;
    154 
    155153        if ( ! isset( $_REQUEST['tag_ID'] ) ) {
    156154                break;
    157155        }
    158156
    159         $tag_ID = (int) $_REQUEST['tag_ID'];
    160 
    161         $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
    162         if ( ! $tag )
     157        $term_id = (int) $_REQUEST['tag_ID'];
     158        $term    = get_term( $term_id );
     159
     160        if ( ! $term instanceof WP_Term ) {
    163161                wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
    164         require_once( ABSPATH . 'wp-admin/admin-header.php' );
    165         include( ABSPATH . 'wp-admin/edit-tag-form.php' );
    166         include( ABSPATH . 'wp-admin/admin-footer.php' );
    167 
     162        }
     163
     164        wp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) );
    168165        exit;
    169166
Note: See TracChangeset for help on using the changeset viewer.