Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 有一个以上的多个字段要发布到";发布“U内容”;_Php_Arrays_Wordpress_Variables_Post - Fatal编程技术网

Php 有一个以上的多个字段要发布到";发布“U内容”;

Php 有一个以上的多个字段要发布到";发布“U内容”;,php,arrays,wordpress,variables,post,Php,Arrays,Wordpress,Variables,Post,我正在尝试创建一个表单应用程序,其中包含多个字段来写入信息 这是我现在正在处理的代码 $type = trim($_POST['Type']); $new_post = array( 'post_title' => $title, 'post_content' => $_POST['description'], 'post_parent' => 65, 'post_status' => 'publish', 'post_type'

我正在尝试创建一个表单应用程序,其中包含多个字段来写入信息

这是我现在正在处理的代码

$type = trim($_POST['Type']);
$new_post = array(
    'post_title' => $title,
    'post_content' => $_POST['description'],
    'post_parent' => 65,
    'post_status' => 'publish',
    'post_type' => 'topic'
);
$topic_meta = array(
    'forum_id'  => $new_post['post_parent']
);
$topic_id = bbp_insert_topic($new_post, $topic_meta);
wp_redirect(get_permalink($topic_id));
exit;
我有更多字段,它们的名称是
customfieldone
customfieldtwo
,我想将它们添加到它从表单创建的主题中

上面的代码只会将
description
中的文本发布到主题中