Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nschaeferhoff/9e8f09d62c862a2cea84f58c6f5beeff to your computer and use it in GitHub Desktop.
Save nschaeferhoff/9e8f09d62c862a2cea84f58c6f5beeff to your computer and use it in GitHub Desktop.
function delay_rss_feed($where) {
global $wpdb;
if ( is_feed() ) {
$now = gmdate('Y-m-d H:i:s');
$wait = '10';
$device = 'MINUTE';
$where.= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'delay_rss_feed');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment