Changeset 58124 for trunk/src/wp-includes/nav-menu-template.php
- Timestamp:
- 05/09/2024 03:14:46 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu-template.php
r57987 r58124 419 419 // If the menu item corresponds to the currently queried post or taxonomy object. 420 420 } elseif ( 421 $menu_item->object_id== $queried_object_id421 (int) $menu_item->object_id === $queried_object_id 422 422 && ( 423 423 ( ! empty( $home_page_id ) && 'post_type' === $menu_item->type 424 && $wp_query->is_home && $home_page_id == $menu_item->object_id )424 && $wp_query->is_home && $home_page_id === (int) $menu_item->object_id ) 425 425 || ( 'post_type' === $menu_item->type && $wp_query->is_singular ) 426 426 || ( 'taxonomy' === $menu_item->type 427 427 && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) 428 && $queried_object->taxonomy == $menu_item->object )428 && $queried_object->taxonomy === $menu_item->object ) 429 429 ) 430 430 ) { … … 513 513 514 514 // Give front page item the 'current-menu-item' class when extra query arguments are involved. 515 } elseif ( $item_url == $front_page_url && is_front_page() ) {515 } elseif ( $item_url === $front_page_url && is_front_page() ) { 516 516 $classes[] = 'current-menu-item'; 517 517 } 518 518 519 if ( untrailingslashit( $item_url ) == home_url() ) {519 if ( untrailingslashit( $item_url ) === home_url() ) { 520 520 $classes[] = 'menu-item-home'; 521 521 } … … 524 524 // Back-compat with wp_page_menu(): add "current_page_parent" to static home page link for any non-page query. 525 525 if ( ! empty( $home_page_id ) && 'post_type' === $menu_item->type 526 && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id526 && empty( $wp_query->is_page ) && $home_page_id === (int) $menu_item->object_id 527 527 ) { 528 528 $classes[] = 'current_page_parent'; … … 550 550 && is_post_type_hierarchical( $queried_object->post_type ) 551 551 && in_array( (int) $parent_item->object_id, $queried_object->ancestors, true ) 552 && $parent_item->object != $queried_object->ID552 && (int) $parent_item->object_id !== $queried_object->ID 553 553 ) || 554 554 … … 560 560 && ( 561 561 ! isset( $queried_object->term_id ) || 562 $parent_item->object_id != $queried_object->term_id562 (int) $parent_item->object_id !== $queried_object->term_id 563 563 ) 564 564 )
Note: See TracChangeset
for help on using the changeset viewer.