Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -19,12 +19,6 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
||||
}
|
||||
$post_ID = $block->context['postId'];
|
||||
|
||||
// Check is needed for backward compatibility with third-party plugins
|
||||
// that might rely on the `in_the_loop` check; calling `the_post` sets it to true.
|
||||
if ( ! in_the_loop() && have_posts() ) {
|
||||
the_post();
|
||||
}
|
||||
|
||||
$is_link = isset( $attributes['isLink'] ) && $attributes['isLink'];
|
||||
$size_slug = isset( $attributes['sizeSlug'] ) ? $attributes['sizeSlug'] : 'post-thumbnail';
|
||||
$attr = get_block_core_post_featured_image_border_attributes( $attributes );
|
||||
@@ -190,12 +184,12 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
|
||||
|
||||
// Border color.
|
||||
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
|
||||
$custom_color = _wp_array_get( $attributes, array( 'style', 'border', 'color' ), null );
|
||||
$custom_color = $attributes['style']['border']['color'] ?? null;
|
||||
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
|
||||
|
||||
// Individual border styles e.g. top, left etc.
|
||||
foreach ( $sides as $side ) {
|
||||
$border = _wp_array_get( $attributes, array( 'style', 'border', $side ), null );
|
||||
$border = $attributes['style']['border'][ $side ] ?? null;
|
||||
$border_styles[ $side ] = array(
|
||||
'color' => isset( $border['color'] ) ? $border['color'] : null,
|
||||
'style' => isset( $border['style'] ) ? $border['style'] : null,
|
||||
|
||||
Reference in New Issue
Block a user