WordPress.org

Plugin Directory

Changeset 997668


Ignore:
Timestamp:
09/27/14 15:06:54 (3 years ago)
Author:
ozh
Message:

2.0.2
fixed: post formats -- fixed -- thanks to @hatsumatsu
fixed: time offset, thanks to @GoldDave
added: new template tag: ozh_ta_is_retweet_or_not()

Location:
ozh-tweet-archiver/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ozh-tweet-archiver/trunk/inc/import.php

    r900989 r997668  
    256256        $tid            = (string)$tweet->id_str; 
    257257        $text           = ozh_ta_linkify_tweet( $tweet ); 
    258         $date           = date( 'Y-m-d H:i:s', strtotime( $tweet->created_at ) ); 
     258        $date           = date( 'Y-m-d H:i:s', strtotime( $tweet->created_at ) + 3600 * get_option('gmt_offset') ); 
    259259        $source         = $tweet->source; 
    260260        $has_hashtags   = count( $tweet->entities->hashtags ) > 0; 
     
    293293            // Post format 
    294294            if ( 'standard' != $ozh_ta['post_format'] ) { 
    295                 $post['post_format'] = 'post-format-' . $ozh_ta['post_format']; 
     295                $post['tax_input'] = array( 'post_format' => array( 'post-format-' . $ozh_ta['post_format'] ) ); 
    296296            } 
     297 
    297298            // Plugins: hack here 
    298299            $post = apply_filters( 'ozh_ta_insert_tweets_post', $post );  
  • ozh-tweet-archiver/trunk/inc/template_tags.php

    r900989 r997668  
    6060} 
    6161add_action( 'ozh_ta_is_reply_or_not', 'ozh_ta_is_reply_or_not', 10, 0 ); 
     62 
     63// Template tag: is_retweet or is_no_retweet 
     64function ozh_ta_is_retweet_or_not( $echo = true ) { 
     65    $what = (bool)preg_match( '/\bRT\s*:?\s*\@/', get_the_title() ) ? 'is_retweet' : 'is_no_retweet'; 
     66    if( $echo ) 
     67        echo $what; 
     68    return $what; 
     69} 
     70add_action( 'ozh_ta_is_retweet_or_not', 'ozh_ta_is_retweet_or_not', 10, 0 ); 
    6271 
    6372// Template tag: "in reply to Ozh" 
  • ozh-tweet-archiver/trunk/ozh-ta.php

    r900989 r997668  
    44Plugin URI: http://planetozh.com/blog/my-projects/ozh-tweet-archiver-backup-twitter-with-wordpress/ 
    55Description: Archive your tweets and import them as posts 
    6 Version: 2.0.1 
     6Version: 2.0.2 
    77Author: Ozh 
    88Author URI: http://ozh.org/ 
     
    2323 *         cronjob should be smarters 
    2424 *         tweaks here and there 
     25 * 
     26 * 2.0.2   post formats -- fixed -- thanks to @hatsumatsu 
     27 *         time offset, thanks to @GoldDave 
     28 *         new template tag: ozh_ta_is_retweet_or_not() 
    2529 */ 
    2630 
Note: See TracChangeset for help on using the changeset viewer.