Created
October 27, 2011 04:08
-
-
Save jmdodd/1318760 to your computer and use it in GitHub Desktop.
Filter tweet timestamp in Ozh' Tweet Archiver to match blog's specified GMT offset
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
<?php | |
if ( ! function_exists( 'ucc_ozh_ta_insert_tweets_post_filter' ) ) { | |
function ucc_ozh_ta_insert_tweets_post_filter( $postarr ) { | |
$offset = get_option( 'gmt_offset' ) * 3600; | |
$date = date( 'Y-m-d H:i:s', strtotime( $postarr['post_date'] . ' UTC' ) + $offset ); | |
$postarr['post_date'] = $date; | |
return $postarr; | |
} } | |
add_filter( 'ozh_ta_insert_tweets_post', 'ucc_ozh_ta_insert_tweets_post_filter' ); | |
/* | |
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com) | |
Released under the GPLv2 (or later). | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment