Changeset 56710 for trunk/src/wp-includes/blocks/home-link.php
- Timestamp:
- 09/26/2023 02:20:18 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/home-link.php
r56065 r56710 99 99 $font_sizes['css_classes'] 100 100 ); 101 $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); 101 102 $classes[] = 'wp-block-navigation-item'; 102 $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); 103 104 if ( is_front_page() ) { 105 $classes[] = 'current-menu-item'; 106 } elseif ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) { 107 // Edge case where the Reading settings has a posts page set but not a static homepage. 108 $classes[] = 'current-menu-item'; 109 } 103 110 104 111 $wrapper_attributes = get_block_wrapper_attributes( … … 125 132 return ''; 126 133 } 134 $aria_current = ''; 127 135 128 $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; 136 if ( is_front_page() ) { 137 $aria_current = ' aria-current="page"'; 138 } elseif ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) { 139 // Edge case where the Reading settings has a posts page set but not a static homepage. 140 $aria_current = ' aria-current="page"'; 141 } 129 142 130 143 return sprintf(
Note: See TracChangeset
for help on using the changeset viewer.