Changeset 54257 for trunk/src/wp-includes/blocks/home-link.php
- Timestamp:
- 09/20/2022 03:14:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/home-link.php
r53157 r54257 90 90 * 91 91 * @param array $context Home link block context. 92 * @return arrayThe li wrapper attributes.92 * @return string The li wrapper attributes. 93 93 */ 94 94 function block_core_home_link_build_li_wrapper_attributes( $context ) { … … 126 126 } 127 127 128 $wrapper_attributes = block_core_home_link_build_li_wrapper_attributes( $block->context );129 130 128 $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; 131 129 132 $html = '<li ' . $wrapper_attributes . '><a class="wp-block-home-link__content wp-block-navigation-item__content" rel="home"' . $aria_current; 133 134 // Start appending HTML attributes to anchor tag. 135 $html .= ' href="' . esc_url( home_url() ) . '"'; 136 137 // End appending HTML attributes to anchor tag. 138 $html .= '>'; 139 140 if ( isset( $attributes['label'] ) ) { 141 $html .= wp_kses_post( $attributes['label'] ); 142 } 143 144 $html .= '</a></li>'; 145 return $html; 130 return sprintf( 131 '<li %1$s><a class="wp-block-home-link__content wp-block-navigation-item__content" href="%2$s" "rel="home"%3$s>%4$s</a></li>', 132 block_core_home_link_build_li_wrapper_attributes( $block->context ), 133 esc_url( home_url() ), 134 $aria_current, 135 wp_kses_post( $attributes['label'] ) 136 ); 146 137 } 147 138
Note: See TracChangeset
for help on using the changeset viewer.