LLMS_Forms::get_field_blocks( array $blocks )

Pull LifterLMS Form Field blocks from an array of parsed WP Blocks.


Description Description

Searches innerBlocks arrays recursively.


Top ↑

Parameters Parameters

$blocks

(array) (Required) Array of WP Block arrays from parse_blocks().


Top ↑

Return Return

(array)


Top ↑

Source Source

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

				$fields[] = $block;
			} elseif ( 'core/html' === $block['blockName'] && ! empty( $block['attrs']['type'] ) ) {
				$fields[] = $block;
			}
		}

		return $fields;
	}

	/**
	 * Returns a list of field names used by LifterLMS forms
	 *
	 * Used to validate uniqueness of custom field data.
	 *
	 * @since 5.0.0
	 *
	 * @return string[]
	 */

Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Pass an empty string to strpos() instead of null.
5.1.0 First check block's innerBlock attribute exists when checking for inner blocks. Also made the access visibility public.
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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