Actually, I am not even sure this ACF feature does what I want… I need to be able to create an order form with Complex field type (allow a visitor to add multiple optional entries in the order form). But I don’t necessarily want them to create a post, only be able to receive the form and process it on the back-end.
Hello,
I’ve got the same need as Marc: build a front-end form with a repeater field and process the data in the background in a complex field type.
To build the repeater field in the front-end form, I use this github Jquery script: https://github.com/DubFriend/jquery.repeater
In a CPT, I’ve got a complex field type:
Container::make( 'post_meta', esc_html__( 'Schedule' , 'katt' ) )
->show_on_post_type( 'presentation' )
->add_fields( array(
Field::make( 'complex', 'complex_presentation_speakers' , esc_html__( 'Speaker(s)' , 'katt' ) )->add_fields( array(
Field::make( 'select' , 'katt_presentation_speakers' , esc_html__( 'Speaker' , 'katt' ) )
->add_options( $katt_presentations_users_dropdown_menu ),
)),
));
– How to structure the array() with the data get from the front Jquery repeater to set it in the complex field ?
– How to name the complex field when setting the array() with add_post_meta ?
add_post_meta(“post_ID” , “field_name-structure ?”, array() );
Thanks for your help.
Since I last wrote I decided to try ACF Pro with the front-end form support and I must say it’s working really well.
I really prefer Carbon Fields and would really like it if support for Front-end form was added.
Thanks.
Hey, thanks for the great suggestion.
Unfortunately we don’t plan to include this feature in CF. We may consider making another plugin just for front-end form handling that works with CF, but it’s not on the roadmap at the moment.