WordPress通过脚本使帖子粘贴?

时间:2010-02-18 05:09:12

标签: wordpress

    // Create post objects
    $my_post = array();
    $my_post['post_title'] = 'Main Blog Post Title';
    $my_post['post_content'] = 'Main Blog Post Content';
    $my_post['post_type'] = 'post';


    // Insert the post into the database
    wp_insert_post($my_post);

如何通过脚本将此帖子粘贴?

1 个答案:

答案 0 :(得分:1)

$post_id = wp_insert_post($my_post);
stick_post($post_id);
相关问题