Change the file used to create the HTML for a field in the front-end. When using this filter, you can make a copy of an existing field file, modify it and use that for a specific field or for all fields of a type

This filter was added in Caldera Forms 1.3.4

Change The File For All Fields Of A Type

add_filter( 'caldera_forms_render_field_file', function( $field_file, $field_type ){
	if( 'dropdown' == $field_type ) {
		return  '/path/to/custom/dropdown.php';

	return $field_file;
}, 10, 2);

Change The File For A Specific Field

add_filter( 'caldera_forms_render_field_file', function( $field_file, $field_type, $field_id ){
	//make sure to change to your field's ID
	if( 'fld_123456' == $field_id ) {
		return  '/path/to/custom/dropdown.php';

	return $field_file;
}, 10, 3);

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