Skip to content

Commit

Permalink
Fix Post Featured Image border attributes (#43426)
Browse files Browse the repository at this point in the history
* Fix Post Featured Image border attributes

* address feedback
  • Loading branch information
ntsekouras authored Aug 19, 2022
1 parent 330f1f4 commit d6b928d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/block-library/src/post-featured-image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
);
}

$border_attributes = gutenberg_style_engine_get_styles( array( 'border' => $border_styles ) );
return array(
'class' => $border_attributes['classnames'],
'style' => $border_attributes['css'],
);
$styles = gutenberg_style_engine_get_styles( array( 'border' => $border_styles ) );
$attributes = array();
if ( ! empty( $styles['classnames'] ) ) {
$attributes['class'] = $styles['classnames'];
}
if ( ! empty( $styles['css'] ) ) {
$attributes['style'] = $styles['css'];
}
return $attributes;
}

/**
Expand Down

0 comments on commit d6b928d

Please sign in to comment.