caldera_forms_editor_extra_fields

Interstellar gases that resemble a red eye in space

This filter was added in Caldera Forms 1.7.0

If you want to create an interface and/or API endpoint for a Caldera Forms add-on or a new feature of Caldera Forms that modifies the form configuration, you need to use this filter. If not, when the form is saved, the indexes of the form configuration array that you added will not be saved and the settings will be lost.

If you want to prevent this from happening, supply an array, with the same indexes as in the form array, with the current values. By doing so, your additional fields will be added back to the form configuration before being sent back to the server. Because these fields are stored in the globally scoped variable “non_editor_fields”, add-on developers may update these values dynamically. This may be useful when using a more modern state management system in the Caldera Forms editor. Think of it as a bridge…

This filter was added to prevent this from happening to privacy/ GDPR settings.

 

Where Does This Code Go?

When using WordPress hooks to customize Caldera Forms or other plugins you should not modify the plugin files, or you will lose your changes when you update the plugin. Instead you should create a small plugin to hold the custom code. It's easy, learn how here.

Technically you can add the custom code to your theme's functions.php, but then you will not be able to change your theme and keep these customizations.

Learn More