Make WordPress Core


Ignore:
Timestamp:
06/27/2023 02:20:18 PM (3 years ago)
Author:
Bernhard Reiter
Message:

Editor: update Wordpress npm packages.

Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.

Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.

File:
1 edited

Legend:

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

    r55246 r56065  
    7373    }
    7474
     75    // Ensure backwards compatibility by flagging the number of columns via classname when using grid layout.
     76    if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) {
     77        $classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] );
     78    }
     79
    7580    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) );
    7681
     
    8691        $block_instance['blockName'] = 'core/null';
    8792
     93        $post_id              = get_the_ID();
     94        $post_type            = get_post_type();
     95        $filter_block_context = static function( $context ) use ( $post_id, $post_type ) {
     96            $context['postType'] = $post_type;
     97            $context['postId']   = $post_id;
     98            return $context;
     99        };
     100        add_filter( 'render_block_context', $filter_block_context );
    88101        // Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling
    89102        // `render_callback` and ensure that no wrapper markup is included.
    90         $block_content = (
    91             new WP_Block(
    92                 $block_instance,
    93                 array(
    94                     'postType' => get_post_type(),
    95                     'postId'   => get_the_ID(),
    96                 )
    97             )
    98         )->render( array( 'dynamic' => false ) );
     103        $block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) );
     104        remove_filter( 'render_block_context', $filter_block_context );
    99105
    100106        // Wrap the render inner blocks in a `li` element with the appropriate post classes.
Note: See TracChangeset for help on using the changeset viewer.