Make WordPress Core


Ignore:
Timestamp:
10/21/2025 07:11:53 AM (3 months ago)
Author:
ellatrix
Message:

Editor: update packages.

Updates the packages to match Gutenberg version 21.9.0 RC2.

Also updates the sync script to work with the new package-lock.json format.
Some reusable block tests were adjusted to work with more render arguments.
Added core-data to the ignore list for verify:source-maps because Yjs has been bundled by accident. To be removed in a follow-up. See https://core.trac.wordpress.org/ticket/64120. See https://github.com/WordPress/gutenberg/pull/72503.

See: https://github.com/WordPress/wordpress-develop/pull/10355.
See: https://core.trac.wordpress.org/ticket/64117.

Props ellatrix, dmsnell.
Fixes #64117.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/post-excerpt.php

    r58187 r61009  
    2121    }
    2222
     23    $more_text           = ! empty( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . wp_kses_post( $attributes['moreText'] ) . '</a>' : '';
     24    $filter_excerpt_more = static function ( $more ) use ( $more_text ) {
     25        return empty( $more_text ) ? $more : '';
     26    };
     27    /**
     28     * Some themes might use `excerpt_more` filter to handle the
     29     * `more` link displayed after a trimmed excerpt. Since the
     30     * block has a `more text` attribute we have to check and
     31     * override if needed the return value from this filter.
     32     * So if the block's attribute is not empty override the
     33     * `excerpt_more` filter and return nothing. This will
     34     * result in showing only one `read more` link at a time.
     35     *
     36     * This hook needs to be applied before the excerpt is retrieved with get_the_excerpt.
     37     * Otherwise, the read more link filter from the theme is not removed.
     38     */
     39    add_filter( 'excerpt_more', $filter_excerpt_more );
     40
    2341    /*
    2442    * The purpose of the excerpt length setting is to limit the length of both
     
    3351    }
    3452
    35     $more_text           = ! empty( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . wp_kses_post( $attributes['moreText'] ) . '</a>' : '';
    36     $filter_excerpt_more = static function ( $more ) use ( $more_text ) {
    37         return empty( $more_text ) ? $more : '';
    38     };
    39     /**
    40      * Some themes might use `excerpt_more` filter to handle the
    41      * `more` link displayed after a trimmed excerpt. Since the
    42      * block has a `more text` attribute we have to check and
    43      * override if needed the return value from this filter.
    44      * So if the block's attribute is not empty override the
    45      * `excerpt_more` filter and return nothing. This will
    46      * result in showing only one `read more` link at a time.
    47      */
    48     add_filter( 'excerpt_more', $filter_excerpt_more );
    4953    $classes = array();
    5054    if ( isset( $attributes['textAlign'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.