Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
Created January 22, 2015 16:33
Show Gist options
  • Save geoffgraham/97066b8915f588aa0fad to your computer and use it in GitHub Desktop.
Save geoffgraham/97066b8915f588aa0fad to your computer and use it in GitHub Desktop.
The Events Calendar 3.9.1 // Change RSS Time
add_filter( 'get_post_time', 'events_rss2_gmt_pubdate_correction', 20 , 3 );
function events_rss2_gmt_pubdate_correction($time, $d, $gmt) {
global $post;
// Amount of hours to change, equals GMT offset
$offset = -7;
if ( $post->post_type === TribeEvents::POSTTYPE && is_feed() ) {
$time = new DateTime( tribe_get_start_date( $post->ID, false, $d ) );
$time->modify( $offset.' hour' );
$time = $time->format( TribeDateUtils::DBDATETIMEFORMAT );
$time = mysql2date( $d, $time );
}
return $time;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment