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::convert_settings_format( array $map, string $orignal_format )
Converts field settings formats
Description Description
There are small differences between the LLMS_Form_Fields settings array and the WP_Block settings array.
This method accepts an associative array in one format or the other and converts it from the original format to the opposite format.
Parameters Parameters
- $map
-
(array) (Required) Associative array of settings.
- $orignal_format
-
(string) (Required) The original format of the submitted
$map. Either "field" for an array of LLMS_Form_Field settings orblockfor an array of WP_Block attributes.
Return Return
([type]) [description]
Source Source
File: includes/forms/class-llms-forms.php
);
// LLMS_Form_Field settings to block attributes.
if ( 'field' === $orignal_format ) {
$keys = array_flip( $keys );
}
// Loop through the original map and rename the necessary keys.
foreach ( $keys as $orig_key => $new_key ) {
if ( isset( $map[ $orig_key ] ) ) {
$map[ $new_key ] = $map[ $orig_key ];
unset( $map[ $orig_key ] );
}
}
return $map;
}
/**
* Converts an array of LLMS_Form_Field settings to a block attributes array
*
* @since 5.0.0
*
* @param array $settings An array of LLMS_Form_Field settings.
* @return array An array of WP_Block attributes.
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |