Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public function get_blocks( string $content, ?int $post_id = null ): array {
* @return array Array of processed valid blocks.
*/
private function process_blocks( array $blocks, ?int $post_id = null ): array {
return array_filter(
array_map(
fn( $block ) => $this->handle_do_block( $block, $post_id ),
$blocks
),
static fn( $block_data ) => false !== $block_data
return array_values(
array_filter(
array_map(
fn( $block ) => $this->handle_do_block( $block, $post_id ),
$blocks
),
static fn( $block_data ) => false !== $block_data
)
);
}

Expand Down