diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 3ee1211..c5c4e94 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -297,7 +297,11 @@ protected function source_block( WP_Block $block, array $filter_options ) { ]; // WP_Block#inner_blocks can be an array or WP_Block_List (iterable). - $inner_blocks = iterator_to_array( $block->inner_blocks ); + if ( is_array( $block->inner_blocks ) ) { + $inner_blocks = $block->inner_blocks; + } else { + $inner_blocks = iterator_to_array( $block->inner_blocks ); + } /** * Filters a block's inner blocks before recursive iteration. diff --git a/vip-block-data-api.php b/vip-block-data-api.php index 0ddb80d..5874815 100644 --- a/vip-block-data-api.php +++ b/vip-block-data-api.php @@ -5,7 +5,7 @@ * Description: Access Gutenberg block data in JSON via the REST API. * Author: WordPress VIP * Text Domain: vip-block-data-api - * Version: 1.4.0 + * Version: 1.4.1 * Requires at least: 6.0 * Tested up to: 6.6 * Requires PHP: 8.0 @@ -20,7 +20,7 @@ if ( ! defined( 'VIP_BLOCK_DATA_API_LOADED' ) ) { define( 'VIP_BLOCK_DATA_API_LOADED', true ); - define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.4.0' ); + define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.4.1' ); define( 'WPCOMVIP__BLOCK_DATA_API__REST_ROUTE', 'vip-block-data-api/v1' ); // Analytics related configs.