这是一些危险的词语“公共……可以直接将数据输入数据库”
您可以编写自己的表单并使用wp_insert_post()
类似这样:
$new_post = array(
\'comment_status\' => \'closed\',
\'ping_status\' => \'closed\',
\'post_author\' => 1, // id of admin, or some other user
\'post_title\' => $_POST[\'title\'],
\'post_name\' => $_POST[\'title\'],
\'post_status\' => \'draft\',
\'post_type\' => \'post\', // or whatever
\'post_date\' => date(\'Y-m-d H:i:s\'),
);
$new_post_id = wp_insert_post( $new_post );