Make WordPress Core


Ignore:
Timestamp:
01/08/2015 10:14:58 PM (10 years ago)
Author:
wonderboymusic
Message:

Properly declare $hook_suffix, $plugin_page, $typenow, and $taxnow as globals in wp-admin/admin.php.

Fixes #30958.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu-header.php

    r31090 r31105  
    6767        }
    6868
    69         if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
     69        if ( ( $parent_file && $item[2] == $parent_file ) || ( ! $typenow && $self == $item[2] ) ) {
    7070            $class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current';
    7171        } else {
     
    168168
    169169                // Handle current for post_type=post|page|foo pages, which won't match $self.
    170                 $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing';
     170                $self_type = $typenow ? $self . '?post_type=' . $typenow : 'nothing';
    171171
    172172                if ( isset( $submenu_file ) ) {
     
    176176                // This allows plugin pages with the same hook to exist under different parents.
    177177                } elseif (
    178                     ( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||
    179                     ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
     178                    ( ! $plugin_page && $self == $sub_item[2] ) ||
     179                    ( $plugin_page && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
    180180                ) {
    181181                    $class[] = 'current';
Note: See TracChangeset for help on using the changeset viewer.