Make WordPress Core


Ignore:
Timestamp:
10/09/2023 05:21:30 PM (5 months ago)
Author:
karmatosed
Message:

Update npm packages to latest versions for 6.4 beta 3.

The npm packages needed a further update for beta 3 in preparation for 6.4.

Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.

See #59411.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/latest-posts.php

    r56710 r56808  
    4949    add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
    5050
    51     $filter_latest_posts_excerpt_more = static function ( $more ) use ( $attributes ) {
    52         $use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
    53         /* translators: %1$s is a URL to a post, excerpt truncation character, default … */
    54         return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
    55     };
    56 
    57     add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
    58 
    5951    if ( ! empty( $attributes['categories'] ) ) {
    6052        $args['category__in'] = array_column( $attributes['categories'], 'id' );
     
    151143
    152144            $trimmed_excerpt = get_the_excerpt( $post );
     145
     146            /*
     147             * Adds a "Read more" link with screen reader text.
     148             * [&hellip;] is the default excerpt ending from wp_trim_excerpt() in Core.
     149             */
     150            if ( str_ends_with( $trimmed_excerpt, ' [&hellip;]' ) ) {
     151                $excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
     152                if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) {
     153                    $trimmed_excerpt  = substr( $trimmed_excerpt, 0, -11 );
     154                    $trimmed_excerpt .= sprintf(
     155                        /* translators: 1: A URL to a post, 2: The static string "Read more", 3: The post title only visible to screen readers. */
     156                        __( '… <a href="%1$s" rel="noopener noreferrer">%2$s<span class="screen-reader-text">: %3$s</span></a>' ),
     157                        esc_url( $post_link ),
     158                        __( 'Read more' ),
     159                        esc_html( $title )
     160                    );
     161                }
     162            }
    153163
    154164            if ( post_password_required( $post ) ) {
Note: See TracChangeset for help on using the changeset viewer.