Update to version 0.10 when it shows a available.
You’ll need to install Add Shortcodes Actions And Filters plugin.
You will need to modify the below example to suite your needs.
Example: you don’t have a “post-content” or “post-title” field in your form, but you want to set those values as a combination of values from other form fields. In this simply example, our form has field “your-name” and “your-email”.
The hook is used to create the “post-content” or “post-title” fields to be text with the value of fields “your-name” and “your-email” embedded in them.
function f2p_consolidate_fields( $form_data ) { // change the function name as needed
$form_title = 'F2P With Hook Example'; // Change this to your form name
if ($form_data->title = $form_title) {
// Next line sets the post_title value - change to match how you want the text
$form_data->posted_data['post_title'] = "Post from {$form_data->posted_data['your-name']}";
// Next line sets the post_content value - change to match how you want the text
$form_data->posted_data['post_content'] =
"This is a post from {$form_data->posted_data['your-name']} with email {$form_data->posted_data['your-email']}";
}
return $form_data;
}
add_filter( 'form_to_post_form_data', 'f2p_consolidate_fields', 10, 1 ); // make sure the function name matches above