WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Tools
Custom post types going out to Twitter (1 post)

  1. singpolyma
    Member
    Posted 3 years ago #

    This plugin does not check post_type before sending out to twitter! As a result using any plugin that makes use of custom post types, such as the DiSo Actionstream plugin, causes all sorts of extra crap to be tweeted! The following is a patch to fix this:

    --- ../twitter-tools.1/twitter-tools.php	2010-08-16 00:22:41.000000000 -0500
    +++ twitter-tools.php	2011-07-06 18:28:38.472157307 -0500
    @@ -485,6 +485,10 @@
     		if ($post->post_status == 'private') {
     			return;
     		}
    +		// check for other post type
    +		if ($post->post_type != 'post') {
    +			return;
    +		}
     		$tweet = new aktt_tweet;
     		$url = apply_filters('tweet_blog_post_url', get_permalink($post_id));
     		$tweet->tw_text = sprintf(__($this->tweet_format, 'twitter-tools'), @html_entity_decode($post->post_title, ENT_COMPAT, 'UTF-8'), $url);
    @@ -2206,4 +2210,4 @@
     	return sprintf(__('%s ago', 'twitter-tools'), $relative_date);
     }
    
    -?>
    \ No newline at end of file
    +?>

    http://wordpress.org/extend/plugins/twitter-tools/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic