From 4fceccbececa24344cc26213aed715ac961ee0d4 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 5 Jan 2009 19:24:49 +0000 Subject: [PATCH] Preserve query string when redirecting to tools. Props simonwheatley. fixes #8774 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@10311 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin.php b/wp-admin/admin.php index f6bfe67c4..fc6f70780 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -61,7 +61,12 @@ if (isset($plugin_page)) { $page_hook = get_plugin_page_hook($plugin_page, $plugin_page); // backwards compatibility for plugins using add_management_page if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) { - wp_redirect('tools.php?page=' . $plugin_page); + // There could be plugin specific params on the URL, so we need the whole query string + if ( !empty($_SERVER[ 'QUERY_STRING' ]) ) + $query_string = $_SERVER[ 'QUERY_STRING' ]; + else + $query_string = 'page=' . $plugin_page; + wp_redirect( 'tools.php?' . $query_string ); exit; } }