Plugin Directory

Changeset 355924


Ignore:
Timestamp:
03/05/2011 09:05:22 PM (15 years ago)
Author:
0xTC
Message:
 
Location:
wp-tweet-button/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-tweet-button/trunk/readme.txt

    r355798 r355924  
    22Contributors: 0xTC
    33Tags: twitter, tweet button, retweet, tweet, autotweet, WP Tweet Button, advanced, tweeting, social media, button, SEO, share, shortener, awe.sm, b2l.me, bit.ly, cli.gs, sl.ly, snipr, su.pr, tinyurl, analytics, google analytics, campaign, campaign tracking, auto tweeting, auto posts
    4 Requires at least: 2.7.2
     4Requires at least: 2.8
    55Tested up to: 3.1
    66Stable tag: trunk
     
    125125== Changelog ==
    126126
     127= 2.0.5 =
     128* Bugfix related to shortlinks and links on main page.
     129
    127130= 2.0.4.3 =
    128131* Improved shortlink handling in Wordpress 3.1. Shortlink settings in this plugin can be set as universal by checking the "Add rel=shortlink to head" box.
  • wp-tweet-button/trunk/wp-tweet-button.php

    r355798 r355924  
    22/*
    33Plugin Name: WP Tweet Button
    4 Version: 2.0.4.3
     4Version: 2.0.5
    55Plugin URI: http://0xtc.com/plugins/wp-tweet-button
    66Description: The WordPress implementation of the official Twitter Tweet Button.
     
    488488    */
    489489    function tw_add_rel_shortlink(){
    490         echo '<link rel="shortlink" href="'.$this->tw_get_short_url().'" />';
     490        if (is_home()){
     491            $url =  home_url();
     492        } else {
     493            $url = $this->tw_get_short_url();
     494        }
     495        echo '<link rel="shortlink" href="'.$url.'" />';
    491496    }
    492497   
     
    589594                remove_action(  'wp_head',                  'wp_shortlink_wp_head', 10, 0 );
    590595                add_action(     'wp_head', array(&$this,    'tw_add_rel_shortlink'));
    591                 if ($this->tw_get_option('tw_url_shortener') != 'wordpress') add_filter('pre_get_shortlink', array(&$this, 'tw_get_short_url'),3);
     596                if (($this->tw_get_option('tw_url_shortener') != 'wordpress')){
     597                   
     598                    add_filter('pre_get_shortlink', array(&$this, 'tw_get_short_url'),3);
     599
     600                    }
    592601            }
    593602        }
     
    870879    function tw_get_long_url($addtrack=false, $addlang=true) {
    871880        global $my_transposh_plugin;
    872    
     881       
     882        if (!in_the_loop() && is_home()){return esc_url(home_url());}
     883       
    873884        if(is_int($this->postid)) {
    874885            $post = get_post($this->postid);
     
    878889        $perms=null;
    879890        if (empty($post->post_title)) {
    880             $perms= 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     891            $perms= esc_url('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    881892        } else {
    882893            $perms = trim(get_permalink($post->ID));
     
    925936            global $post;
    926937        }
     938       
     939        if (!in_the_loop() && is_home()){return esc_url(home_url());}
     940       
    927941        $perms = $this->tw_get_long_url(true);
    928942        if ($perms == false) return false;
     
    11341148    function tweetbutton($post,$bwdata=false) {
    11351149        global $post;
    1136         $post = get_post($this->postid);
     1150//      $thepost = get_post($this->postid);
    11371151        $this->postid = $post->ID;
    11381152        if (isset($post->ID)){
     
    20412055        $wpTweetButton->tw_set_option('tw_count', $type);
    20422056    }
    2043     return $wpTweetButton->tweetbutton($post,$bwdata);
     2057    return $wpTweetButton->tweetbutton($thepost,$bwdata);
    20442058}
    20452059
Note: See TracChangeset for help on using the changeset viewer.