【发布时间】:2014-04-11 09:46:33
【问题描述】:
$date = date("Y-m-d H:i:s"); $date = strtotime("+60 minutes"); $date = date("Y-m-d H:i:s", $date); $postId = wp_insert_post(array( 'post_author' => 1, 'post_category' => $kategori, 'post_content' => $aciklama, 'post_status' => 'future', 'post_date' => $date, 'post_date_gmt' =>$date, 'post_title' => $adi, 'post_excerpt' => '', 'post_type' => 'post', 'tags_input' => $etiketler ));
上面的代码我已经写好了。它将帖子插入数据库,我在文章列表中看到了该帖子。但它不会在时间到来时发布(现在 + 60 分钟)。我错过了什么?到时候我应该写点什么让它出版吗?
【问题讨论】:
-
设置 -> 常规页面中的时区是否正确?
-
是的,这似乎是正确的。还有另一个机器人按预期工作。不幸的是,我看不到它的代码。
标签: php wordpress scheduled-tasks