WordPress.org

Make WordPress Core

Ticket #34988: 34988-tag_ID.diff

File 34988-tag_ID.diff, 1.7 KB (added by swissspidy, 5 years ago)

Fix tag_ID variable in edit-tag-form.php

  • src/wp-admin/edit-tag-form.php

    diff --git src/wp-admin/edit-tag-form.php src/wp-admin/edit-tag-form.php
    index 6a4500b..a50685e 100644
    if ( 'category' == $taxonomy ) { 
    4949 */
    5050wp_reset_vars( array( 'wp_http_referer' ) );
    5151
    52 $wp_http_referer = remove_query_arg( array( 'action', 'message', 'term_id' ), $wp_http_referer );
     52$wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );
    5353
    5454/** Also used by Edit Tags */
    5555require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
    do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?> 
    9696do_action( "{$taxonomy}_term_edit_form_tag" );
    9797?>>
    9898<input type="hidden" name="action" value="editedtag"/>
    99 <input type="hidden" name="tag_ID" value="<?php echo esc_attr( $term_id ) ?>"/>
     99<input type="hidden" name="tag_ID" value="<?php echo esc_attr( $tag_ID ) ?>"/>
    100100<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ) ?>"/>
    101101<?php
    102102wp_original_referer_field( true, 'previous' );
    103 wp_nonce_field( 'update-tag_' . $term_id );
     103wp_nonce_field( 'update-tag_' . $tag_ID );
    104104
    105105/**
    106106 * Fires at the beginning of the Edit Term form.
  • src/wp-admin/term.php

    diff --git src/wp-admin/term.php src/wp-admin/term.php
    index 5454874..d541732 100644
    if ( empty( $_REQUEST['tag_ID'] ) ) { 
    1919        exit;
    2020}
    2121
    22 $term_id = absint( $_REQUEST['tag_ID'] );
    23 $tag     = get_term( $term_id, '', OBJECT, 'edit' );
     22$tag_ID = absint( $_REQUEST['tag_ID'] );
     23$tag    = get_term( $tag_ID, '', OBJECT, 'edit' );
    2424
    2525if ( ! $tag instanceof WP_Term ) {
    2626        wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );