Skip to content

Instantly share code, notes, and snippets.

How to set Caldera Forms field default value from ACF field. See: https://calderaforms.com/doc/caldera_forms_render_get_field/
<?php
/**
* Set Caldera Forms Field default from ACF field
*/
add_filter( 'caldera_forms_render_get_field', function( $field ) {
//Change your field ID here
if( 'fld123456' == $field[ 'ID' ] ){
$field[ 'config' ][ 'default' ] = get_field( 'field_name' );
}
return $field;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment