function webform_example_element_properties_webform_element_default_properties_alter in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_example_element_properties/webform_example_element_properties.module \webform_example_element_properties_webform_element_default_properties_alter()
Implements hook_webform_element_default_properties_alter().
File
- modules/
webform_example_element_properties/ webform_example_element_properties.module, line 13 - Provides an example that shows how to add custom properties to Webform elements.
Code
function webform_example_element_properties_webform_element_default_properties_alter(array &$properties, array &$definition) {
// Add custom data property to all webform elements.
// Setting the custom property to an empty string makes the corresponding
// element defined via hook_webform_element_configuration_form_alter()
// automatically visible.
$properties['custom_data'] = '';
}