diff --git a/extensions/blocks/podcast-player/podcast-player.php b/extensions/blocks/podcast-player/podcast-player.php index 7ddca2111236..c26a1ae5b83b 100644 --- a/extensions/blocks/podcast-player/podcast-player.php +++ b/extensions/blocks/podcast-player/podcast-player.php @@ -55,7 +55,7 @@ function register_block() { /** * Podcast Player block registration/dependency declaration. * - * @param array $attributes Array containing the Podcast Player block attributes. + * @param array|WP_Block $attributes Podcast Player block attributes / WP_Block instance. * @return string */ function render_block( $attributes ) { @@ -79,6 +79,18 @@ function render_block( $attributes ) { return '

' . esc_html( $player_data->get_error_message() ) . '

'; } + /* + * Get the block attributes checking if `$attributes` + * is an array and it has defined a property. + * + * It handles the dual-behavior of argument + * of the callback_render() function, which + * was recently introduced by this Pull Request: + * https://github.com/WordPress/gutenberg/pull/21467 + */ + if ( ! empty( $attributes->attributes ) ) { + $attributes = $attributes->attributes; + } return render_player( $player_data, $attributes ); }