WordPress.org

Make WordPress Core

Ticket #21454: fix-constant-screen-ids.21454.diff

File fix-constant-screen-ids.21454.diff, 600 bytes (added by mikejolley, 2 years ago)

Uses the menu_slug for the screen ID instead of a sanitized page title.

  • wp-admin/includes/plugin.php

    diff --git wp-admin/includes/plugin.php wp-admin/includes/plugin.php
    index f305ef9..3a10edf 100644
    function get_plugin_page_hookname( $plugin_page, $parent_page ) { 
    15281528                        $page_type = 'toplevel'; 
    15291529                else 
    15301530                        if ( isset( $admin_page_hooks[$parent] )) 
    1531                                 $page_type = $admin_page_hooks[$parent]; 
     1531                                $page_type = $parent; 
    15321532        } else if ( isset( $admin_page_hooks[$parent] ) ) { 
    1533                 $page_type = $admin_page_hooks[$parent]; 
     1533                $page_type = $parent; 
    15341534        } 
    15351535 
    15361536        $plugin_name = preg_replace( '!\.php!', '', $plugin_page );