Contact form 7 zu benutzerdefinierten post-Typ

Ich würde gerne Prozess ein Kontaktformular von contact form 7 in einer benutzerdefinierten post-Typ.

Derzeit, das ist, was ich habe:

<?php 

if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&        $_POST['action'] == "front_post") {

//store our post vars into variables for later use
//now would be a good time to run some basic error checking/validation
//to ensure that data for these values have been set
$title     = $_POST['title'];
$content   = $_POST['content'];
$Interest   = $_POST['Interest'];
$post_type = 'purchase';


//the array of arguements to be inserted with wp_insert_post
$new_post = array(
'post_title'    => $title,
'post_content'  => $content,
'tags_input'  => $tags,
'posted_data' => $Interest,
'post_status'   => 'publish',
'post_category' => array('0',$_POST['cat']),          
'post_type'     => $post_type 
);

//insert the the post into database by passing $new_post to wp_insert_post
//store our post ID in a variable $pid
//we now use $pid (post id) to help add out post meta data
$pid=wp_insert_post($new_post);

//we now use $pid (post id) to help add out post meta data
add_post_meta($pid, 'cust_key', $custom_field);


}
?>

Hier ist ein link zu der eigentlichen form: http://stage.icardpromotions.com/create-purchase-order/

Brauche ich, um in der Lage zu ziehen, in all die info-Formular dieses Formular in die custom-post-Typ "Kauf"

Wie Sie sehen können, bin ich derzeit ziehen in der post_content, post_title, etc.

Habe ich auch schon versucht zu ziehen, in die Inhalte aus content-form von input name "Interesse", aber es Dosis nicht funktionieren.

Hat jemand eine Ahnung, wie dies zu tun?

InformationsquelleAutor Kyle Poyser | 2017-02-06
Schreibe einen Kommentar