1
您好,我已經爲wordpress製作了一個PHP腳本,它通過wp_insert_post使用自定義類型插入新帖子。 使用上面的代碼我可以得到帖子保存,但我不能使用管理面板進行編輯。我想知道爲什麼?有誰能夠幫助我?將wp_insert_post()用於自定義帖子類型帖子已保存但不可編輯
$post = array(
'comment_status' => 'closed',
'post_author' => 1,
'post_date' => date('Y-m-d H:i:s'),
'post_content' => $postdata['name'],
'post_status' => 'publish',
'post_title' => strtoupper(strip_tags($postdata['name'])),
'post_type' => 'xCustom' // custom type
);
wp_insert_post($post);
謝謝