Changeset 54257 for trunk/src/wp-includes/blocks/site-title.php
- Timestamp:
- 09/20/2022 03:14:54 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/site-title.php
r53157 r54257 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 26 24 if ( isset( $attributes['level'] ) ) { 27 25 $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . (int) $attributes['level']; … … 29 27 30 28 if ( $attributes['isLink'] ) { 31 $link_attrs = array( 32 'href="' . esc_url( get_bloginfo( 'url' ) ) . '"', 33 'rel="' . esc_attr( 'home' ) . '"', 29 $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; 30 $link_target = ! empty( $attributes['linkTarget'] ) ? $attributes['linkTarget'] : '_self'; 31 32 $site_title = sprintf( 33 '<a href="%1$s" target="%2$s" rel="home"%3$s>%4$s</a>', 34 esc_url( home_url() ), 35 esc_attr( $link_target ), 34 36 $aria_current, 37 esc_html( $site_title ) 35 38 ); 36 if ( '_blank' === $attributes['linkTarget'] ) {37 $link_attrs[] = 'target="_blank"';38 }39 $site_title = sprintf( '<a %1$s>%2$s</a>', implode( ' ', $link_attrs ), esc_html( $site_title ) );40 39 } 41 40 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
Note: See TracChangeset
for help on using the changeset viewer.