Changeset 36308
- Timestamp:
- 01/15/2016 08:26:06 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-tag-form.php
r35875 r36308 8 8 9 9 // 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; 10 if ( ! defined( 'ABSPATH' ) ) { 11 die( '-1' ); 20 12 } 21 13 … … 58 50 wp_reset_vars( array( 'wp_http_referer' ) ); 59 51 60 $wp_http_referer = remove_query_arg( array( 'action', 'message', 't ag_ID' ), $wp_http_referer );52 $wp_http_referer = remove_query_arg( array( 'action', 'message', 'term_id' ), $wp_http_referer ); 61 53 62 54 /** Also used by Edit Tags */ … … 104 96 do_action( "{$taxonomy}_term_edit_form_tag" ); 105 97 ?>> 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 102 wp_original_referer_field( true, 'previous' ); 103 wp_nonce_field( 'update-tag_' . $term_id ); 104 ?> 110 105 <table class="form-table"> 111 106 <tr class="form-field form-required term-name-wrap"> -
trunk/src/wp-admin/edit-tags.php
r36302 r36308 151 151 152 152 case 'edit': 153 $title = $tax->labels->edit_item;154 155 153 if ( ! isset( $_REQUEST['tag_ID'] ) ) { 156 154 break; 157 155 } 158 156 159 $t ag_ID= (int) $_REQUEST['tag_ID'];160 161 $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' ); 162 if ( ! $t ag )157 $term_id = (int) $_REQUEST['tag_ID']; 158 $term = get_term( $term_id ); 159 160 if ( ! $term instanceof WP_Term ) { 163 161 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 ) ) ); 168 165 exit; 169 166 -
trunk/src/wp-includes/link-template.php
r36300 r36308 927 927 928 928 $args = array( 929 'action' => 'edit',930 929 'taxonomy' => $taxonomy, 931 't ag_ID'=> $term->term_id,930 'term_id' => $term->term_id, 932 931 ); 933 932 … … 939 938 940 939 if ( $tax->show_ui ) { 941 $location = add_query_arg( $args, admin_url( ' edit-tags.php' ) );940 $location = add_query_arg( $args, admin_url( 'term.php' ) ); 942 941 } else { 943 942 $location = '';
Note: See TracChangeset
for help on using the changeset viewer.