1

我找不到如何在原始插件http://wordpress.org/extend/plugins/missed-schedule-wordpress-plugin-fix/http://wordpress.org的 cronjob 中实现这些行的方法/extend/plugins/wp-missed-schedule/没关系=)

function fix_missed_shedule() {
global $table_prefix;   
    $now_time = strftime("%Y-%m-%d %H:%M:%S", _NOW_TIME);
    $sql = "SELECT `ID` FROM `".$table_prefix."posts` WHERE `post_date_gmt` <= '".$now_time."' AND `post_status` LIKE 'future' LIMIT 0 , 35";
    $result = mysql_query($sql);
    while ($row = mysql_fetch_assoc($result)) {
wp_publish_post($row['ID']);
    }
}

摘要:
- 35 的限制不是必需
的 - 与数据库的连接就像这里描述的一样http://www.werockyourweb.com/cron-job-mysql,每个博客都有他的数据库、用户、IP/HOST、表

自 3 天以来,我一直在寻找这个问题的答案,哈哈

简而言之,我需要实现什么才能在 CRONJOB 中运行:如果日期早于当前时间,则将
帖子的状态从“post_date” “future”中的“wp_posts”表更改为“publish”

更新!!!!!!!!!!!!我自己找到了答案,它:好的,有人告诉我答案,给你:

update database_name.wp_posts set wp_posts.post_status='publish'  where post_date<=now() and post_date_gmt<=now()
4

0 回答 0