mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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 432ed388f8...6566f5fe9e.
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.
Fixes #57038, #56818, #56955, #56923.
git-svn-id: https://develop.svn.wordpress.org/trunk@54811 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -29,11 +29,18 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
||||
$attr['alt'] = $post_title;
|
||||
}
|
||||
|
||||
if ( ! empty( $attributes['height'] ) ) {
|
||||
$extra_styles = "height:{$attributes['height']};";
|
||||
if ( ! empty( $attributes['scale'] ) ) {
|
||||
$extra_styles .= "object-fit:{$attributes['scale']};";
|
||||
}
|
||||
$attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
|
||||
}
|
||||
|
||||
$featured_image = get_the_post_thumbnail( $post_ID, $size_slug, $attr );
|
||||
if ( ! $featured_image ) {
|
||||
return '';
|
||||
}
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
if ( $is_link ) {
|
||||
$link_target = $attributes['linkTarget'];
|
||||
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
||||
@@ -49,23 +56,9 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
||||
$featured_image = $featured_image . $overlay_markup;
|
||||
}
|
||||
|
||||
$has_width = ! empty( $attributes['width'] );
|
||||
$has_height = ! empty( $attributes['height'] );
|
||||
if ( ! $has_height && ! $has_width ) {
|
||||
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
||||
}
|
||||
|
||||
if ( $has_width ) {
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
|
||||
}
|
||||
|
||||
if ( $has_height ) {
|
||||
$image_styles = "height:{$attributes['height']};";
|
||||
if ( ! empty( $attributes['scale'] ) ) {
|
||||
$image_styles .= "object-fit:{$attributes['scale']};";
|
||||
}
|
||||
$featured_image = str_replace( '<img ', '<img style="' . esc_attr( safecss_filter_attr( $image_styles ) ) . '" ', $featured_image );
|
||||
}
|
||||
$wrapper_attributes = empty( $attributes['width'] )
|
||||
? get_block_wrapper_attributes()
|
||||
: get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
|
||||
|
||||
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
||||
}
|
||||
|
||||
@@ -193,6 +193,11 @@ function build_template_part_block_instance_variations() {
|
||||
if ( wp_installing() ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if ( ! current_theme_supports( 'block-templates' ) && ! current_theme_supports( 'block-template-parts' ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$variations = array();
|
||||
$template_parts = get_block_templates(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user