小编Kyl*_*ser的帖子

联系表格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'  => …
Run Code Online (Sandbox Code Playgroud)

php forms contact-form-7 custom-post-type

4
推荐指数
2
解决办法
7941
查看次数

标签 统计

contact-form-7 ×1

custom-post-type ×1

forms ×1

php ×1