Skip to content

Commit

Permalink
Change the_ID to queried_object_id (#43800)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Sep 6, 2022
1 parent 4468fb2 commit 2d1e007
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {

$css_classes = trim( implode( ' ', $classes ) );
$has_submenu = count( $block->inner_blocks ) > 0;
$is_active = ! empty( $attributes['id'] ) && ( get_the_ID() === (int) $attributes['id'] );
$is_active = ! empty( $attributes['id'] ) && ( get_queried_object_id() === (int) $attributes['id'] );

$wrapper_attributes = get_block_wrapper_attributes(
array(
Expand Down

0 comments on commit 2d1e007

Please sign in to comment.