Ticket #44111: 44111.diff
File 44111.diff, 1.1 KB (added by , 6 years ago) |
---|
-
src/wp-admin/admin.php
168 168 do_action( 'admin_init' ); 169 169 170 170 if ( isset( $plugin_page ) ) { 171 $the_parent = $pagenow; 171 172 if ( ! empty( $typenow ) ) { 172 173 $the_parent = $pagenow . '?post_type=' . $typenow; 173 } else {174 $the_parent = $pagenow;175 174 } 175 176 176 if ( ! $page_hook = get_plugin_page_hook( $plugin_page, $the_parent ) ) { 177 177 $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page ); 178 178 179 179 // Back-compat for plugins using add_management_page(). 180 180 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook( $plugin_page, 'tools.php' ) ) { 181 $query_string = 'page=' . $plugin_page; 181 182 // There could be plugin specific params on the URL, so we need the whole query string 182 183 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 183 184 $query_string = $_SERVER['QUERY_STRING']; 184 } else {185 $query_string = 'page=' . $plugin_page;186 185 } 186 187 187 wp_redirect( admin_url( 'tools.php?' . $query_string ) ); 188 188 exit; 189 189 }