From f14fc1392cd8884cfa7db27cf19f5218c4cbc2b0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 23 Sep 2019 19:10:58 +0000 Subject: [PATCH] Taxonomy: Redirect to the correct URL after deleting a taxonomy term attached to a post type other than Post. Props donmhico, mukesh27 Fixes #47858 Built from https://develop.svn.wordpress.org/trunk@46263 git-svn-id: http://core.svn.wordpress.org/trunk@46075 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/term.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/term.php b/wp-admin/term.php index ec8b359d5d..48932209e0 100644 --- a/wp-admin/term.php +++ b/wp-admin/term.php @@ -15,7 +15,12 @@ if ( empty( $_REQUEST['tag_ID'] ) ) { if ( ! empty( $taxnow ) ) { $sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback ); } - wp_redirect( esc_url( $sendback ) ); + + if ( 'post' !== get_current_screen()->post_type ) { + $sendback = add_query_arg( 'post_type', get_current_screen()->post_type, $sendback ); + } + + wp_redirect( esc_url_raw( $sendback ) ); exit; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 623da0d8dd..2538497ba4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46262'; +$wp_version = '5.3-alpha-46263'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.