Changeset 52042 for trunk/src/wp-includes/blocks/site-title.php
- Timestamp:
- 11/08/2021 02:26:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/site-title.php
r51199 r52042 22 22 $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; 23 23 24 $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; 25 24 26 if ( isset( $attributes['level'] ) ) { 25 27 $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level']; 26 28 } 27 29 28 $link = sprintf( '<a href="%1$s" rel="home">%2$s</a>', get_bloginfo( 'url' ), $site_title ); 30 if ( $attributes['isLink'] ) { 31 $link_attrs = array( 32 'href="' . get_bloginfo( 'url' ) . '"', 33 'rel="home"', 34 $aria_current, 35 ); 36 if ( '_blank' === $attributes['linkTarget'] ) { 37 $link_attrs[] = 'target="_blank"'; 38 $link_attrs[] = 'aria-label="' . esc_attr__( '(opens in a new tab)' ) . '"'; 39 } 40 $site_title = sprintf( '<a %1$s>%2$s</a>', implode( ' ', $link_attrs ), $site_title ); 41 } 29 42 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); 30 43 … … 33 46 $tag_name, 34 47 $wrapper_attributes, 35 $ link48 $site_title 36 49 ); 37 50 }
Note: See TracChangeset
for help on using the changeset viewer.