Created
January 22, 2015 16:33
-
-
Save geoffgraham/97066b8915f588aa0fad to your computer and use it in GitHub Desktop.
The Events Calendar 3.9.1 // Change RSS Time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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