Make WordPress Core


Ignore:
Timestamp:
11/08/2021 02:26:27 PM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.

This brings the JS packages up to date and is the first step that will allow us
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/site-title.php

    r51199 r52042  
    2222    $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
    2323
     24    $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : '';
     25
    2426    if ( isset( $attributes['level'] ) ) {
    2527        $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level'];
    2628    }
    2729
    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    }
    2942    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
    3043
     
    3346        $tag_name,
    3447        $wrapper_attributes,
    35         $link
     48        $site_title
    3649    );
    3750}
Note: See TracChangeset for help on using the changeset viewer.