summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php')
-rw-r--r--plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php b/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php
index 9b3af865..92df64dd 100644
--- a/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php
+++ b/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php
@@ -50,6 +50,13 @@ function register_block() {
),
),
'render_callback' => __NAMESPACE__ . '\render_block',
+ 'supports' => array(
+ 'align' => array( 'wide', 'full' ),
+ 'spacing' => array(
+ 'padding' => true,
+ 'margin' => true,
+ ),
+ ),
// Since Gutenberg #31873.
'style' => 'wp-mediaelement',
@@ -159,13 +166,13 @@ function render_player( $player_data, $attributes ) {
$player_classes_name = trim( "{$secondary_colors['class']} {$background_colors['class']}" );
$player_inline_style = trim( "{$secondary_colors['style']} ${background_colors['style']}" );
$player_inline_style .= get_css_vars( $attributes );
-
- $block_classname = Blocks::classes( FEATURE_NAME, $attributes, array( 'is-default' ) );
- $is_amp = Blocks::is_amp_request();
+ $wrapper_attributes = \WP_Block_Supports::get_instance()->apply_block_supports();
+ $block_classname = Blocks::classes( FEATURE_NAME, $attributes, array( 'is-default' ) );
+ $is_amp = Blocks::is_amp_request();
ob_start();
?>
- <div class="<?php echo esc_attr( $block_classname ); ?>" id="<?php echo esc_attr( $instance_id ); ?>">
+ <div class="<?php echo esc_attr( $block_classname ); ?>"<?php echo ! empty( $wrapper_attributes['style'] ) ? ' style="' . esc_attr( $wrapper_attributes['style'] ) . '"' : ''; ?> id="<?php echo esc_attr( $instance_id ); ?>">
<section
class="jetpack-podcast-player <?php echo esc_attr( $player_classes_name ); ?>"
style="<?php echo esc_attr( $player_inline_style ); ?>"