Make WordPress Core

Ticket #44111: 44111.diff

File 44111.diff, 1.1 KB (added by rnaby, 7 years ago)

The patch for the ticket.

  • src/wp-admin/admin.php

     
    168168do_action( 'admin_init' );
    169169
    170170if ( isset( $plugin_page ) ) {
     171        $the_parent = $pagenow;
    171172        if ( ! empty( $typenow ) ) {
    172173                $the_parent = $pagenow . '?post_type=' . $typenow;
    173         } else {
    174                 $the_parent = $pagenow;
    175174        }
     175
    176176        if ( ! $page_hook = get_plugin_page_hook( $plugin_page, $the_parent ) ) {
    177177                $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page );
    178178
    179179                // Back-compat for plugins using add_management_page().
    180180                if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook( $plugin_page, 'tools.php' ) ) {
     181                        $query_string = 'page=' . $plugin_page;
    181182                        // There could be plugin specific params on the URL, so we need the whole query string
    182183                        if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
    183184                                $query_string = $_SERVER['QUERY_STRING'];
    184                         } else {
    185                                 $query_string = 'page=' . $plugin_page;
    186185                        }
     186
    187187                        wp_redirect( admin_url( 'tools.php?' . $query_string ) );
    188188                        exit;
    189189                }