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::modify_toggle_blocks( array[] $blocks )
Modifies block settings for toggle-controlled fields
Parameters Parameters
- $blocks
-
(array[]) (Required) Array of WP_Block arrays.
Return Return
(array[])
Source Source
File: includes/forms/class-llms-forms-dynamic-fields.php
private function modify_toggle_blocks( $blocks ) { // List of toggle fields to modify. $fields = array( 'email_address', 'email_address_confirm', 'password', 'password_confirm', ); foreach ( $blocks as &$block ) { if ( ! empty( $block['innerBlocks'] ) ) { $block['innerBlocks'] = $this->modify_toggle_blocks( $block['innerBlocks'] ); } elseif ( ! empty( $block['attrs']['id'] ) && in_array( $block['attrs']['id'], $fields, true ) ) { $block['attrs']['wrapper_classes'] = 'llms-visually-hidden-field'; $block['attrs']['disabled'] = true; $block['attrs']['required'] = true; } } return $blocks; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |