Make WordPress Core


Ignore:
Timestamp:
09/15/2015 03:58:04 PM (11 years ago)
Author:
wonderboymusic
Message:

Don't redirect to the Term list table after submitting the form on the Edit Term page.

Props chiragswadia, UmeshSingla, rhyswynne, afercia.
Fixes #17455.

File:
1 edited

Legend:

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

    r32974 r34202  
    4949    do_action( 'edit_tag_form_pre', $tag );
    5050}
     51
     52/**
     53 * Use with caution, see http://codex.wordpress.org/Function_Reference/wp_reset_vars
     54 */
     55wp_reset_vars( array( 'wp_http_referer' ) );
     56
     57$wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );
     58
     59/** Also used by Edit Tags */
     60require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
     61
    5162/**
    5263 * Fires before the Edit Term form for all taxonomies.
     
    6475<div class="wrap">
    6576<h1><?php echo $tax->labels->edit_item; ?></h1>
     77
     78<?php if ( $message ) : ?>
     79<div id="message" class="updated">
     80    <p><strong><?php echo $message; ?></strong></p>
     81    <?php if ( $wp_http_referer ) { ?>
     82    <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php printf( __( '&larr; Back to %s' ), $tax->labels->name ); ?></a></p>
     83    <?php } else { ?>
     84    <p><a href="<?php echo esc_url( wp_get_referer() ); ?>"><?php printf( __( '&larr; Back to %s' ), $tax->labels->name ); ?></a></p>
     85    <?php } ?>
     86</div>
     87<?php endif; ?>
     88
    6689<div id="ajax-response"></div>
     90
    6791<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"
    6892<?php
Note: See TracChangeset for help on using the changeset viewer.