1
こんにちは私はwp_insert_post経由でカスタムタイプを使用して新しい投稿を挿入するwordpress用のPHPスクリプトを作成しました。 上記のコードを使用すると、投稿は保存できますが、管理パネルを使用して編集することはできません。なぜだろう?誰でも私を助けることができますか?カスタムポストタイプの投稿にwp_insert_post()を使用すると保存されますが編集不可能
'post_type' => 'xCustom'
あなたが使用する必要があります:
'post_type' => 'xcustom'
私はちょうど過ごし
$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);
は