function wpcf7_to_post($cfdata) {
// Daten aus der Anfrage auslesen
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$formdata = $submission->get_posted_data();
}
// Post ID des Formulares angeben, welches "abgefangen" werden soll
if ( $cfdata->id() == '318') {
$newdraft = array(
'post_title'=> $formdata['your-name'],
'post_status' => 'draft', // Status
'post_type' => 'post', // Post Type
);
// Eintrag als Entwurf anlegen
$newpostid = wp_insert_post($newdraft);
// Hier werden zustzlich Customfields befllt
// add_post_meta($newpostid, 'customfield01', $formdata['strasse']);
// add_post_meta($newpostid, 'customfield02', $formdata['plzort']);
}
}
add_action('wpcf7_before_send_mail', 'wpcf7_to_post',1);
//http://drwp.de/daten-via-contact-form-7-als-beitrag-speichern/