summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/post-featured-image.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
commitfc0a79914946dac00ccd51b1aacffe267de7210e (patch)
tree1403384efbfe8f8776ff60aaa40f7d535c02c822 /wp-includes/blocks/post-featured-image.php
parentReleasing progress-linux version 6.5.5+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.tar.xz
wordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.zip
Merging upstream version 6.6.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/blocks/post-featured-image.php')
-rw-r--r--wp-includes/blocks/post-featured-image.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/wp-includes/blocks/post-featured-image.php b/wp-includes/blocks/post-featured-image.php
index 9a1fd31..815da4e 100644
--- a/wp-includes/blocks/post-featured-image.php
+++ b/wp-includes/blocks/post-featured-image.php
@@ -8,6 +8,8 @@
/**
* Renders the `core/post-featured-image` block on the server.
*
+ * @since 5.8.0
+ *
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
@@ -48,6 +50,13 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
if ( ! empty( $attributes['scale'] ) ) {
$extra_styles .= "object-fit:{$attributes['scale']};";
}
+ if ( ! empty( $attributes['style']['shadow'] ) ) {
+ $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) );
+
+ if ( ! empty( $shadow_styles['css'] ) ) {
+ $extra_styles .= $shadow_styles['css'];
+ }
+ }
if ( ! empty( $extra_styles ) ) {
$attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
@@ -125,6 +134,8 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
/**
* Generate markup for the HTML element that will be used for the overlay.
*
+ * @since 6.1.0
+ *
* @param array $attributes Block attributes.
*
* @return string HTML markup in string format.
@@ -191,6 +202,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
* Generates class names and styles to apply the border support styles for
* the Post Featured Image block.
*
+ * @since 6.1.0
+ *
* @param array $attributes The block attributes.
* @return array The border-related classnames and styles for the block.
*/
@@ -241,6 +254,8 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
/**
* Registers the `core/post-featured-image` block on the server.
+ *
+ * @since 5.8.0
*/
function register_block_core_post_featured_image() {
register_block_type_from_metadata(