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.