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
This commit is contained in:
John Blackbourn 2019-09-23 19:10:58 +00:00
parent 49c63c104f
commit f14fc1392c
2 changed files with 7 additions and 2 deletions

View File

@ -15,7 +15,12 @@ if ( empty( $_REQUEST['tag_ID'] ) ) {
if ( ! empty( $taxnow ) ) { if ( ! empty( $taxnow ) ) {
$sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback ); $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; exit;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.