• I built a custom post type ( currently those are workshops) and I wish to use this form as a registration process. The question is simple, is there a way to combine a specific custom field ( cost) to the value of the autopopulate field instead of just the title or ID ? The final goal is to be able to get the total of multiple choice in a Math field and display it as TOTAL.

    That would be a huge time savor.

    Thank you

    https://ww.wp.xz.cn/plugins/caldera-forms/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter loiclejour

    (@ataxel)

    I don’t know if it’s too complex, but passing a meta to the form should be doable, isn’t it ?

    Plugin Author Josh Pollock

    (@shelob9)

    Making what you are asking for possible was actually something I was working on to make the auto-complete field type that we are currently prototyping (going to have to wait a few weeks for those) more flexible. Thanks for the push to get this part of it finished.

    There will be 4 new filters in CF 1.2.2 (coming in the next day or so) to change what fields are use for autopopulate option labels/values. I’ll have an article on our site on how it works once the new version is released.

    In the meantime, check out this commit, the new filters have inline docs
    https://github.com/Desertsnowman/Caldera-Forms/commit/3897d4ef12c944a64b37be51c7aa04e2c18dfe74

    Plugin Author Josh Pollock

    (@shelob9)

    @atextel I wrote up an example of how to use the meta field for the value (CF 1.2.2 or later) as well as how to use a filter for the options instead of auto-population:

    https://calderawp.com/doc/customizing-auto-populated-field-options-in-caldera-forms/

    Thread Starter loiclejour

    (@ataxel)

    Wow, so clear, totally what was needed for my project!
    Thank you for it and for pods also 😉

    Thread Starter loiclejour

    (@ataxel)

    Well, the last question will be, where to put the code, in functions.php or in the plugin itself ?

    Thread Starter loiclejour

    (@ataxel)

    My code will be :

    add_filter( 'caldera_forms_autopopulate_options_post_value_field', function( $value_field, $field ) {
        if( 'atelier' == $field[ 'slug' ] ) {
            $value_field = 'cout';
        }
    
        return $value_field;
    }, 24, 2 );

    where atelier is the custom post type and cout the custom field. I can’t have COUT to be display in the autopopulate value option.

    Thank you again for your time!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Populate field values’ is closed to new replies.