Pippin 和Jean-Baptiste Jung 有非常好的教程,介绍如何在使用以下四个操作挂钩发布新帖子时以编程方式创建内容。。。
发布{post\\u type}
global $user_ID;
$new_post = array(
\'post_title\' => \'My New Post\',
\'post_content\' => \'Lorem ipsum dolor sit amet...\',
\'post_status\' => \'publish\',
\'post_date\' => date(\'Y-m-d H:i:s\'),
\'post_author\' => $user_ID,
\'post_type\' => \'post\',
\'post_category\' => array(0)
);
$post_id = wp_insert_post($new_post);
我应该使用什么钩子来执行此功能only 何时更新帖子?非常感谢。