WordPress延迟RSS订阅

WordPress延迟RSS订阅

function publish_later_on_feed($where) {
    global $wpdb;
    if (is_feed()) {
        $now = gmdate('Y-m-d H:i:s');
        $wait = '5';
        $device = 'MINUTE';
        // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
        $where .= " AND TIMESTAMPDIFF({$device}, {$wpdb->posts}.post_date_gmt, '{$now}') > {$wait} ";
    }
    return $where;
}
add_filter('posts_where', 'publish_later_on_feed');

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据