Custom post type support

The plugin allows you to override the way data is saved. If save form data is turned on, it saves the data to its own database by default. However, the save procedure can be overwritten.

In the following example, the information you provided when filling out the form is saved as your own custom post type entry:

functions.php:
function my_save_data_action($options, $data) {
    // $form_to_pdf_891_saved_data --> successful save flag: must be set to true or false
    global $wpdb, $form_to_pdf_891_saved_data;

    // $options --> array, Form call parameters from shortcode
    // $data --> array, the information provided in the form

    $id = wp_insert_post(array(
                'post_title'  => $data["title"],
                'post_type'   => $options["post_type"],
                'post_status' => 'publish'
            ));
    if (!empty($id)) {
        add_post_meta($id, 'my_meta', $data["meta"]);
    }

    // If the save was successful
    $form_to_pdf_891_saved_data = true;
}

if (has_action('form_to_pdf_save_data_action')) {
    remove_action( 'form_to_pdf_save_data_action', 'form_to_pdf_891_save_data_action' );
    add_action( 'form_to_pdf_save_data_action', 'my_save_data_action', 10, 2);
}

Please note that the code above is incomplete, for illustration only.