有谁知道如何使用 sql 将新帖子插入 Wordpress 中?
最佳答案
您可以使用 Post 对象:
// Create post object
$my_post = array();
$my_post['post_title'] = 'My post';
$my_post['post_content'] = 'This is my post.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
$my_post['post_category'] = array(8,39);
// Insert the post into the database
wp_insert_post( $my_post );
找到更多信息 here .
关于mysql - 使用 MySql 在 Wordpress 中插入帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1670838/