Hello Rebecca,
I understand that you want to set the post type based on the select field after submitting the frontend submission form. I share with you an example of how to make it work:
1. I have a field group and a simple select field with the options is the CPT slug and label:
[
'name' => __( 'Content type', 'your-text-domain' ),
'id' => 'content_type',
'type' => 'select',
'options' => [
'book' => __( 'Book', 'your-text-domain' ),
'post' => __( 'Post', 'your-text-domain' ),
'page' => __( 'Page', 'your-text-domain' ),
],
],
2. This field group is added to the frontend form.
3. I use this code to update the post type of the submitted post based on the select:
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
if ( isset( $_POST['content_type'] ) ) {
$post_type = $_POST['content_type'];
$my_post = [
'ID' => $post_id,
'post_type' => $post_type
];
wp_update_post( $my_post );
}
}, 10, 2 );
Refer to the documentation
https://docs.metabox.io/extensions/mb-frontend-submission/#form-hooks
https://developer.wordpress.org/reference/functions/wp_update_post/
Note: this is an example. If it doesn't work or does not meet your requirements, you can contact us here to request a customization service https://metabox.io/contact/