Set the screen for add-tag ajax requests. see #13783
git-svn-id: http://svn.automattic.com/wordpress/trunk@15178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
10b86ca5f7
commit
2439833a7e
|
@ -575,6 +575,9 @@ case 'add-tag' : // From Manage->Tags
|
|||
$x->send();
|
||||
}
|
||||
|
||||
if ( isset($_POST['screen']) )
|
||||
set_current_screen($_POST['screen']);
|
||||
|
||||
$level = 0;
|
||||
$tag_full_name = false;
|
||||
$tag_full_name = $tag->name;
|
||||
|
|
|
@ -383,6 +383,7 @@ if ( current_user_can($tax->cap->edit_terms) ) {
|
|||
<h3><?php echo $tax->labels->add_new_item; ?></h3>
|
||||
<form id="addtag" method="post" action="edit-tags.php" class="validate">
|
||||
<input type="hidden" name="action" value="add-tag" />
|
||||
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<?php wp_nonce_field('add-tag'); ?>
|
||||
|
||||
|
|
|
@ -3909,8 +3909,15 @@ function set_current_screen( $id = '' ) {
|
|||
$current_screen = str_replace('-add', '', $current_screen);
|
||||
$current_screen = array('id' => $current_screen, 'base' => $current_screen);
|
||||
} else {
|
||||
if ( false !== strpos($id, '-') )
|
||||
$id = sanitize_key($id);
|
||||
if ( false !== strpos($id, '-') ) {
|
||||
list( $id, $typenow ) = explode('-', $id, 2);
|
||||
if ( is_taxonomy($typenow) ) {
|
||||
$id = 'edit-tags';
|
||||
$taxnow = $typenow;
|
||||
$typenow = '';
|
||||
}
|
||||
}
|
||||
$current_screen = array('id' => $id, 'base' => $id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue