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_Forms_Dynamic_Fields::add_block( array[] $blocks, array $block_settings, integer $index )

Creates a new HTML block with the given settings and inserts it into an existing blocks array at the specified location


Parameters Parameters

$blocks

(array[]) (Required) Array of WP_Block arrays.

$block_settings

(array) (Required) Block attributes used to generate a new custom HTML field block.

$index

(integer) (Required) Desired index of the new block.


Top ↑

Return Return

(array[])


Top ↑

Source Source

File: includes/forms/class-llms-forms-dynamic-fields.php

	private function add_block( $blocks, $block_settings, $index ) {

		// Make the new block.
		$add_block = parse_blocks(
			LLMS_Forms::instance()->get_custom_field_block_markup( $block_settings )
		);

		// Add it into the form after the specified index.
		array_splice( $blocks, $index + 1, 0, $add_block );

		return $blocks;

	}


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.