I don’t know if it’s too complex, but passing a meta to the form should be doable, isn’t it ?
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
@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/
Wow, so clear, totally what was needed for my project!
Thank you for it and for pods also 😉
Well, the last question will be, where to put the code, in functions.php or in the plugin itself ?
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!