Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Form_Templates::prepare_blocks( array[] $blocks )
Recursively prepare a list of blocks to ensure it can be passed into serialize_blocks() without error
Parameters Parameters
- $blocks
-
(array[]) (Required) Array of WP_Block definition arrays.
Return Return
(array[])
Source Source
File: includes/forms/class-llms-form-templates.php
private static function prepare_blocks( $blocks ) { foreach ( $blocks as &$block ) { $block = wp_parse_args( $block, array( 'attrs' => array(), 'innerBlocks' => array(), ) ); if ( ! empty( $block['innerBlocks'] ) ) { $block['innerBlocks'] = self::prepare_blocks( $block['innerBlocks'] ); } // WP core serialize_block() doesn't work unless this... $block['innerContent'] = array_fill( 0, count( $block['innerBlocks'] ), null ); } return $blocks; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |