我想将联系人表单从联系人表单7处理为自定义帖子类型。联系表单7至自定义帖子类型
目前,这是我有:
<?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);
}
?>
下面是实际的形式链接:http://stage.icardpromotions.com/create-purchase-order/
我需要能够在所有信息中拉形成这种形式进入自定义后键入“购买”
正如你所看到的,我目前拉在POST_CONTENT,POST_TITLE等
我也试图拉从内容形式的内容通过输入名称“兴趣”,但它不起作用。
有没有人有线索如何做到这一点?
感谢您的回复@Aurovrata,我试过发布我的CF7表单,但有一些限制,我也想将表单连接到插件路线图中的现有自定义发布类型 –
,最终它将允许您张贴到现有的帖子类型。 – Aurovrata
@KylePoyser上周发布的插件v2.0现在包含了将表单映射到现有帖子类型的能力 – Aurovrata