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.
Parameters Parameters
- $blocks
-
(array) (Required) Array of WP Block arrays from
parse_blocks().
Return Return
(array)
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[]
*/
Expand full source code Collapse full source code View on GitHub
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. |