Make WordPress Core


Ignore:
Timestamp:
01/15/2016 08:26:06 AM (7 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-tag-form.php

    r35875 r36308  
    88
    99// don't load directly
    10 if ( !defined('ABSPATH') )
    11     die('-1');
    12 
    13 if ( empty($tag_ID) ) { ?>
    14 <div class="wrap">
    15     <h1><?php echo $tax->labels->edit_item; ?></h1>
    16     <div id="message" class="notice notice-warning"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
    17 </div>
    18 <?php
    19     return;
     10if ( ! defined( 'ABSPATH' ) ) {
     11    die( '-1' );
    2012}
    2113
     
    5850wp_reset_vars( array( 'wp_http_referer' ) );
    5951
    60 $wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );
     52$wp_http_referer = remove_query_arg( array( 'action', 'message', 'term_id' ), $wp_http_referer );
    6153
    6254/** Also used by Edit Tags */
     
    10496do_action( "{$taxonomy}_term_edit_form_tag" );
    10597?>>
    106 <input type="hidden" name="action" value="editedtag" />
    107 <input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
    108 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy) ?>" />
    109 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?>
     98<input type="hidden" name="action" value="editedtag"/>
     99<input type="hidden" name="tag_ID" value="<?php echo esc_attr( $term_id ) ?>"/>
     100<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ) ?>"/>
     101<?php
     102wp_original_referer_field( true, 'previous' );
     103wp_nonce_field( 'update-tag_' . $term_id );
     104?>
    110105    <table class="form-table">
    111106        <tr class="form-field form-required term-name-wrap">
Note: See TracChangeset for help on using the changeset viewer.