Make WordPress Core


Ignore:
Timestamp:
11/11/2022 02:54:01 PM (2 years ago)
Author:
desrosj
Message:

Editor: Update block editor packages to the latest patch releases.

This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.1.1.

For a full list of what’s included in this update, see https://github.com/WordPress/gutenberg/compare/432ed388f8d0614f9de775738b24b0ea96664715...6566f5fe9ece6ad5ae550349d3b1f0944a011040.

Props aaronrobertshaw, ntsekouras, bernhard-reiter, ramonopoly, isabel_brison, andrewserong, get_dave, scruffian, andraganescu, talldanwp, mciampini, noisysocks, cbravobernal, bph, tyxla, ellatrix, czapla, mcsf, ironprogrammer, wildworks, peterwilsoncc, mamaduka, mikachan, spacedmonkey, cybr, youknowriad, alexstine, aristath, kevin940726, ndiego, 0mirka00, poena, joen, ryankienstra, desrosj, vtad, nithins53, audrasjb, kacper3355, sabernhardt.
Merges [54811] to the 6.1 branch.
Fixes #57038, #56818, #56955, #56923.

Location:
branches/6.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1

  • branches/6.1/src/wp-includes/blocks/post-featured-image.php

    r54694 r54812  
    3030    }
    3131
     32    if ( ! empty( $attributes['height'] ) ) {
     33        $extra_styles = "height:{$attributes['height']};";
     34        if ( ! empty( $attributes['scale'] ) ) {
     35            $extra_styles .= "object-fit:{$attributes['scale']};";
     36        }
     37        $attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
     38    }
     39
    3240    $featured_image = get_the_post_thumbnail( $post_ID, $size_slug, $attr );
    3341    if ( ! $featured_image ) {
    3442        return '';
    3543    }
    36     $wrapper_attributes = get_block_wrapper_attributes();
    3744    if ( $is_link ) {
    3845        $link_target    = $attributes['linkTarget'];
     
    5057    }
    5158
    52     $has_width  = ! empty( $attributes['width'] );
    53     $has_height = ! empty( $attributes['height'] );
    54     if ( ! $has_height && ! $has_width ) {
    55         return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
    56     }
    57 
    58     if ( $has_width ) {
    59         $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
    60     }
    61 
    62     if ( $has_height ) {
    63         $image_styles = "height:{$attributes['height']};";
    64         if ( ! empty( $attributes['scale'] ) ) {
    65             $image_styles .= "object-fit:{$attributes['scale']};";
    66         }
    67         $featured_image = str_replace( '<img ', '<img style="' . esc_attr( safecss_filter_attr( $image_styles ) ) . '" ', $featured_image );
    68     }
     59    $wrapper_attributes = empty( $attributes['width'] )
     60        ? get_block_wrapper_attributes()
     61        : get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
    6962
    7063    return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
Note: See TracChangeset for help on using the changeset viewer.