Better Click To Tweet - Version 4.2

Version Description

  • added the ability to specify a custom URL as a shortcode parameter. (more info at the power user tutorial at http://benlikes.us/7r )
Download this release

Release Info

Developer ben.meredith@gmail.com
Plugin Icon 128x128 Better Click To Tweet
Version 4.2
Comparing to
See all releases

Code changes from version 4.1.1 to 4.2

Files changed (2) hide show
  1. better-click-to-tweet.php +17 -13
  2. readme.txt +5 -2
better-click-to-tweet.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Better Click To Tweet
4
  Description: The only Click To Tweet plugin to add translation support. The only Click To Tweet plugin to take into account your Twitter username's length in truncating long tweets, or to correctly take into account non-Roman characters. Simply put, as Click To Tweet plugins go, this one is, well, BETTER.
5
- Version: 4.1.1
6
  Author: Ben Meredith
7
  Author URI: http://benandjacq.com
8
  Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
@@ -115,25 +115,29 @@ function bctt_shortcode( $atts ) {
115
 
116
  }
117
 
118
- $text = $tweet;
 
 
 
 
 
 
119
 
120
- if( $url != 'no' ){
121
 
122
- if ( get_option('bctt-short-url') != false ) {
123
 
124
- $bcttURL = '&url=' . wp_get_shortlink();
125
-
126
- } else {
127
 
128
- $bcttURL = '&url=' . get_permalink();
129
 
130
- }
131
 
132
- } else {
133
-
134
- $bcttURL = '';
135
 
136
- }
 
 
137
 
138
  $bcttBttn = sprintf( _x( 'Click To Tweet', 'Text for the box on the reader-facing box', 'better-click-to-tweet' ) );
139
 
2
  /*
3
  Plugin Name: Better Click To Tweet
4
  Description: The only Click To Tweet plugin to add translation support. The only Click To Tweet plugin to take into account your Twitter username's length in truncating long tweets, or to correctly take into account non-Roman characters. Simply put, as Click To Tweet plugins go, this one is, well, BETTER.
5
+ Version: 4.2
6
  Author: Ben Meredith
7
  Author URI: http://benandjacq.com
8
  Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
115
 
116
  }
117
 
118
+ $text = $tweet;
119
+
120
+ if( filter_var( $url, FILTER_VALIDATE_URL ) ) {
121
+
122
+ $bcttURL = '&url=' . $url;
123
+
124
+ } elseif( $url != 'no' ){
125
 
126
+ if ( get_option('bctt-short-url') != false ) {
127
 
128
+ $bcttURL = '&url=' . wp_get_shortlink();
129
 
130
+ } else {
 
 
131
 
132
+ $bcttURL = '&url=' . get_permalink();
133
 
134
+ }
135
 
136
+ } else {
 
 
137
 
138
+ $bcttURL = '';
139
+
140
+ }
141
 
142
  $bcttBttn = sprintf( _x( 'Click To Tweet', 'Text for the box on the reader-facing box', 'better-click-to-tweet' ) );
143
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: click to tweet, twitter, tweet, twitter plugin, Twitter boxes, share, social media, post, posts, plugin, auto post, bitly, bit.ly, yourls, yourls.org, translation-ready
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 4.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -33,7 +33,7 @@ Translators:
33
 
34
  * Español (es_ES): Jordi Rosalez
35
  * Serbian (sr_RS): [Borisa Djuraskovic](http://www.webhostinghub.com/ "Web Hosting Hub")
36
- * Finnish/Suomi (fi): [Sampsa Daavitsainen](http://www.calltoaction.fi/ "CallToAction.fi")
37
  * Russian (ru_RU): webbolt
38
 
39
  == Installation ==
@@ -108,6 +108,9 @@ I want to maximize the usefulness of this plugin by translating it into multiple
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 4.1.1 =
112
  * added Russian translation
113
  * added sample bcttstyle.css file (for moving to the root of the /uploads folder) to assets/css
4
  Tags: click to tweet, twitter, tweet, twitter plugin, Twitter boxes, share, social media, post, posts, plugin, auto post, bitly, bit.ly, yourls, yourls.org, translation-ready
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
33
 
34
  * Español (es_ES): Jordi Rosalez
35
  * Serbian (sr_RS): [Borisa Djuraskovic](http://www.webhostinghub.com/ "Web Hosting Hub")
36
+ * Finnish/Suomi (fi): [Sampsa Daavitsainen](http://www.calltoaction.fi/ "CallToAction.fi")
37
  * Russian (ru_RU): webbolt
38
 
39
  == Installation ==
108
 
109
  == Changelog ==
110
 
111
+ = 4.2 =
112
+ * added the ability to specify a custom URL as a shortcode parameter. (more info at the power user tutorial at http://benlikes.us/7r )
113
+
114
  = 4.1.1 =
115
  * added Russian translation
116
  * added sample bcttstyle.css file (for moving to the root of the /uploads folder) to assets/css