• Resolved vbk100

    (@vbk100)


    Hello,

    Please let me know how to use custom fields created with ACF on Caldera forms. I am unable to find any guide on that.

    • This topic was modified 7 years, 6 months ago by vbk100.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Josh Pollock

    (@shelob9)

    @vbk100

    Thanks for using Caldera Forms.

    Custom fields can be used to populate Caldera Forms fields defaults using the caldera_forms_render_get_field

    There is an example for this scenario in the docs:
    https://calderaforms.com/doc/caldera_forms_render_get_field/

    Thread Starter vbk100

    (@vbk100)

    Josh,

    I went ahead and added a function like this:

    add_filter( 'caldera_forms_render_get_field', function( $field )  {
      //Change your field ID here
      if( 'fld_1612298' == $field[ 'ID' ] ){
    		  $field[ 'config' ][ 'default' ] = get_field( 'field_name' );
      }
      return $field;
    });

    Whereas fld_1612298 is my caldera form’s field and my_website is a ACF field. I am not seeing the URL being added to the custom field neither in the post edit screen not the front end. Could you tell me if I am missing anything here?

    • This reply was modified 7 years, 6 months ago by vbk100.
    Thread Starter vbk100

    (@vbk100)

    I found a workaround.

    Thank you!

    • This reply was modified 7 years, 6 months ago by vbk100.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use ACF fields’ is closed to new replies.