Make WordPress Core


Ignore:
Timestamp:
03/02/2020 11:19:06 PM (5 years ago)
Author:
jorgefilipecosta
Message:

Block Editor: Update WordPress Packages WordPress 5.4 RC 1.

The following package versions were changed:
@wordpress/annotations: 1.12.0 -> 1.12.1
@wordpress/block-directory: 1.5.2 -> 1.5.3
@wordpress/block-editor: 3.7.2 -> 3.7.3
@wordpress/block-library: 2.14.2 -> 2.14.3
@wordpress/blocks: 6.12.0 -> 6.12.1
@wordpress/components: 9.2.2 -> 9.2.3
@wordpress/core-data: 2.12.0 -> 2.12.1
@wordpress/data: 4.14.0 -> 4.14.1
@wordpress/data-controls: 1.8.0 -> 1.8.1
@wordpress/edit-post: 3.13.2 -> 3.13.3
@wordpress/editor: 9.12.2 -> 9.12.3
@wordpress/format-library: 1.14.2 -> 1.14.3
@wordpress/keyboard-shortcuts: 1.1.0 -> 1.1.1
@wordpress/list-reusable-blocks: 1.13.2 -> 1.13.3
@wordpress/notices: 2.0.0 -> 2.0.1
@wordpress/nux: 3.12.2 -> 3.12.3
@wordpress/priority-queue: 1.5.0 -> 1.5.1
@wordpress/rich-text: 3.12.0 -> 3.12.1
@wordpress/server-side-render: 1.8.2 -> 1.8.3
@wordpress/viewport: 2.13.0 -> 2.13.1

Props aduth.
Fixes: #49567.

File:
1 edited

Legend:

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

    r47250 r47408  
    77
    88/**
     9 * The excerpt length set by the Latest Posts core block
     10 * set at render time and used by the block itself.
     11 *
     12 * @var int
     13 */
     14$block_core_latest_posts_excerpt_length = 0;
     15
     16/**
     17 * Callback for the excerpt_length filter used by
     18 * the Latest Posts block at render time.
     19 *
     20 * @return int Returns the global $block_core_latest_posts_excerpt_length variable
     21 *             to allow the excerpt_length filter respect the Latest Block setting.
     22 */
     23function block_core_latest_posts_get_excerpt_length() {
     24    global $block_core_latest_posts_excerpt_length;
     25    return $block_core_latest_posts_excerpt_length;
     26}
     27
     28/**
    929 * Renders the `core/latest-posts` block on server.
    1030 *
     
    1434 */
    1535function render_block_core_latest_posts( $attributes ) {
     36    global $block_core_latest_posts_excerpt_length;
     37
    1638    $args = array(
    1739        'posts_per_page'   => $attributes['postsToShow'],
     
    2143        'suppress_filters' => false,
    2244    );
     45
     46    $block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
     47    add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
    2348
    2449    if ( isset( $attributes['categories'] ) ) {
     
    112137    }
    113138
     139    remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
     140
    114141    $class = 'wp-block-latest-posts wp-block-latest-posts__list';
    115142    if ( isset( $attributes['align'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.