Skip to content

Commit

Permalink
Site Title: Fix logic for 'aria-current' attribute (#68909)
Browse files Browse the repository at this point in the history
Unlinked contributors: [email protected].

Co-authored-by: carolinan <[email protected]>
Co-authored-by: joedolson <[email protected]>
Co-authored-by: hbhalodia <[email protected]>
Co-authored-by: sabernhardt <[email protected]>
Co-authored-by: bschneidewind <[email protected]>
  • Loading branch information
6 people authored and Mamaduka committed Mar 5, 2025
1 parent bc06abf commit 9f8d16d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/site-title/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function render_block_core_site_title( $attributes ) {
}

if ( $attributes['isLink'] ) {
$aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : '';
$aria_current = ! is_paged() && ( is_front_page() || is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) ? ' aria-current="page"' : '';
$link_target = ! empty( $attributes['linkTarget'] ) ? $attributes['linkTarget'] : '_self';

$site_title = sprintf(
Expand Down

0 comments on commit 9f8d16d

Please sign in to comment.