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.


Top ↑

Return Return

(array[])


Top ↑

Source Source

File: includes/forms/class-llms-form-templates.php

				$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;
	}

	/**
	 * Modifies the `required` block attribute
	 *
	 * @since 5.0.0
	 *
	 * @param array   $block    A WP_Block definition array.
	 * @param boolean $required Desired value of the required attribute.
	 */
	private static function set_required_atts( $block, $required ) {

		if ( isset( $block['attrs']['required'] ) && 'llms/form-field-user-address-street-secondary' !== $block['blockName'] ) {
			$block['attrs']['required'] = $required;
		}

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.