Ticket #49239: menu-header.php.2.patch
| File menu-header.php.2.patch, 3.7 KB (added by , 6 years ago) |
|---|
-
menu-header.php
88 88 $submenu_items = $submenu[ $item[2] ]; 89 89 } 90 90 91 if ( ( $parent_file && $item[2] == $parent_file ) || ( empty( $typenow ) && $self== $item[2] ) ) {91 if ( ( $parent_file && $item[2] === $parent_file ) || ( empty( $typenow ) && $self === $item[2] ) ) { 92 92 if ( ! empty( $submenu_items ) ) { 93 93 $class[] = 'wp-has-current-submenu wp-menu-open'; 94 94 } else { … … 157 157 if ( false !== $pos ) { 158 158 $menu_file = substr( $menu_file, 0, $pos ); 159 159 } 160 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {160 if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 161 161 $admin_is_parent = true; 162 162 echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>"; 163 163 } else { … … 170 170 if ( false !== $pos ) { 171 171 $menu_file = substr( $menu_file, 0, $pos ); 172 172 } 173 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {173 if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 174 174 $admin_is_parent = true; 175 175 echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; 176 176 } else { … … 208 208 $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing'; 209 209 210 210 if ( isset( $submenu_file ) ) { 211 if ( $submenu_file == $sub_item[2] ) {211 if ( $submenu_file === $sub_item[2] ) { 212 212 $class[] = 'current'; 213 213 $aria_attributes .= ' aria-current="page"'; 214 214 } … … 215 215 // If plugin_page is set the parent must either match the current page or not physically exist. 216 216 // This allows plugin pages with the same hook to exist under different parents. 217 217 } elseif ( 218 ( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||219 ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2]== $self || file_exists( $menu_file ) === false ) )218 ( ! isset( $plugin_page ) && $self === $sub_item[2] ) || 219 ( isset( $plugin_page ) && $plugin_page === $sub_item[2] && ( $item[2] === $self_type || $item[2] === $self || file_exists( $menu_file ) === false ) ) 220 220 ) { 221 221 $class[] = 'current'; 222 222 $aria_attributes .= ' aria-current="page"'; … … 237 237 238 238 $title = wptexturize( $sub_item[0] ); 239 239 240 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) {240 if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) { 241 241 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 242 242 if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) { 243 243 $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] );