Plugin Directory

Changeset 1359241


Ignore:
Timestamp:
02/26/2016 10:07:26 PM (10 years ago)
Author:
Space_Studio
Message:

Updated the auto truncate calculation.

Location:
click-tweet/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • click-tweet/trunk/click-and-tweet.php

    r1356073 r1359241  
    44 * Plugin URI: http://spacestud.io
    55 * Description: Quote text in your WordPress posts for easy sharing on twitter.
    6  * Version: 0.8.3
     6 * Version: 0.8.4
    77 * Author: Space Studio
    88 * Author URI: http://spacestud.io
     
    5757     * @var string
    5858     */
    59     protected $version = '0.8.3';
     59    protected $version = '0.8.4';
    6060
    6161    /**
     
    712712    private function autoTruncate($text, $username, $url, $hashtag)
    713713    {
     714        if(empty($this->settings['use_auto_truncate'])) return $text;
     715
    714716        $more = "...";
    715717        $moreLength = strlen($more);
     
    724726        $x = $hashtagLength + $viaLength + $usernameLength + $urlLength + $moreLength;
    725727
    726         if(isset($this->settings['use_auto_truncate']) && ($this->settings['use_auto_truncate'] == 1)) {
    727             if($totalLength > 140) {
    728                 $text = wp_html_excerpt($text, $totalLength - 140);
    729                 $y = 140 - $x;
    730                 $text = wp_html_excerpt($text, $y - 3, $more);
    731             }
     728        if($totalLength > 140) {
     729            $text = wp_html_excerpt($text, 140);
     730            $y = strlen($text) - $x;
     731            $text = wp_html_excerpt($text, $y - 3, $more);
    732732        }
    733733
  • click-tweet/trunk/readme.txt

    r1356075 r1359241  
    44Author Url: http://spacestud.io/
    55Requires at least: 3.8
    6 Tested up to: 4.4.1
     6Tested up to: 4.4.3
    77Stable tag: trunk
    88License: GNU Version 2 or Any Later Version
     
    2222Read the documentation here:
    2323
    24 [Documentation](https://space-studio.gitbooks.io/click-tweet-plugin/content/)
     24**[Documentation](https://space-studio.gitbooks.io/click-tweet-plugin/content/)**
    2525
    2626== Installation ==
     
    4747
    4848== Changelog ==
     49= 0.8.4 =
     50* Made an adjustment to the auto truncate calculation.
     51
    4952= 0.8.3 =
    5053* Added a way to remove tweets from the popover.
Note: See TracChangeset for help on using the changeset viewer.