Better Click To Tweet - Version 4.6

Version Description

  • The click to tweet box is now output as a <span instead of a <div> giving the ability (with custom CSS) to "inline" a click to tweet box.
Download this release

Release Info

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

Code changes from version 4.5.3 to 4.6

assets/css/styles.css CHANGED
@@ -8,6 +8,7 @@
8
  border-radius: 4px;
9
  padding: 15px 15px 15px 30px;
10
  margin-bottom: 1em;
 
11
  }
12
 
13
  .bctt-click-to-tweet:after {
8
  border-radius: 4px;
9
  padding: 15px 15px 15px 30px;
10
  margin-bottom: 1em;
11
+ margin-top: 1.75em;
12
  }
13
 
14
  .bctt-click-to-tweet:after {
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.5.3
6
  Author: Ben Meredith
7
  Author URI: http://benandjacq.com
8
  Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
@@ -16,12 +16,12 @@ defined( 'ABSPATH' ) or die( "No soup for you. You leave now." );
16
 
17
  /*
18
  * Strips the html, shortens the text (after checking for mb_internal_encoding compatibility)
19
- * and adds an ellipsis is the text has been shortened
20
  *
21
- * @param $input
22
- * @param $length
23
- * @param $ellipsis
24
- * @param $strip_html
25
  */
26
 
27
  function bctt_shorten( $input, $length, $ellipsis = true, $strip_html = true ) {
@@ -74,7 +74,7 @@ function bctt_shorten( $input, $length, $ellipsis = true, $strip_html = true ) {
74
  * Creates the bctt shortcode
75
  *
76
  * @since 0.1
77
- * @param $atts
78
  *
79
  */
80
 
@@ -165,7 +165,7 @@ function bctt_shortcode( $atts ) {
165
 
166
  if ( ! is_feed() ) {
167
 
168
- return "<div class='bctt-click-to-tweet'><span class='bctt-ctt-text'><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank'" . $rel . ">" . $short . " </a></span><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank' class='bctt-ctt-btn'" . $rel . ">" . $bcttBttn . "</a></div><script async src='//platform.twitter.com/widgets.js' charset='utf-8'></script>";
169
  } else {
170
 
171
  return "<hr /><p><em>" . $short . "</em><br /><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank' class='bctt-ctt-btn'" . $rel . ">" . $bcttBttn . "</a><br /><hr />";
@@ -194,7 +194,7 @@ function bctt_scripts() {
194
 
195
  if ( $custom != 'true' ) {
196
 
197
- wp_register_style( 'bcct_style', plugins_url( 'assets/css/styles.css', __FILE__ ), false, '2.0', 'all' );
198
 
199
  wp_enqueue_style( 'bcct_style' );
200
 
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.6
6
  Author: Ben Meredith
7
  Author URI: http://benandjacq.com
8
  Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
16
 
17
  /*
18
  * Strips the html, shortens the text (after checking for mb_internal_encoding compatibility)
19
+ * and adds an ellipsis if the text has been shortened
20
  *
21
+ * @param string $input raw text string from the shortcode
22
+ * @param int $length length for truncation
23
+ * @param bool $ellipsis boolean for whether the text has been truncated
24
+ * @param bool $strip_html ensures that html is stripped from text string
25
  */
26
 
27
  function bctt_shorten( $input, $length, $ellipsis = true, $strip_html = true ) {
74
  * Creates the bctt shortcode
75
  *
76
  * @since 0.1
77
+ * @param array $atts an array of shortcode attributes
78
  *
79
  */
80
 
165
 
166
  if ( ! is_feed() ) {
167
 
168
+ return "<span class='bctt-click-to-tweet'><span class='bctt-ctt-text'><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank'" . $rel . ">" . $short . " </a></span><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank' class='bctt-ctt-btn'" . $rel . ">" . $bcttBttn . "</a></span><script async src='//platform.twitter.com/widgets.js' charset='utf-8'></script>";
169
  } else {
170
 
171
  return "<hr /><p><em>" . $short . "</em><br /><a href='https://twitter.com/intent/tweet?text=" . rawurlencode( html_entity_decode( $short ) ) . $handle_code . $bcttURL . "' target='_blank' class='bctt-ctt-btn'" . $rel . ">" . $bcttBttn . "</a><br /><hr />";
194
 
195
  if ( $custom != 'true' ) {
196
 
197
+ wp_register_style( 'bcct_style', plugins_url( 'assets/css/styles.css', __FILE__ ), false, '3.0', 'all' );
198
 
199
  wp_enqueue_style( 'bcct_style' );
200
 
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, translate-me, Español, Deutsch, Russian, Finnish, Svenska, Suomi, Italiano,
5
  Requires at least: 3.8
6
  Tested up to: 4.4
7
- Stable tag: 4.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -109,6 +109,9 @@ I want to maximize the usefulness of this plugin by translating it into multiple
109
 
110
  == Changelog ==
111
 
 
 
 
112
  = 4.5.3 =
113
  * fixed an issue that was causing browsers to load older cached versions of the css.
114
  * made no noticable attempts at overthrowing governments, but I did post something on facebook about Donald Trump which made some waves.
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, translate-me, Español, Deutsch, Russian, Finnish, Svenska, Suomi, Italiano,
5
  Requires at least: 3.8
6
  Tested up to: 4.4
7
+ Stable tag: 4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 4.6 =
113
+ * The click to tweet box is now output as a `<span` instead of a `<div>` giving the ability (with custom CSS) to "inline" a click to tweet box.
114
+
115
  = 4.5.3 =
116
  * fixed an issue that was causing browsers to load older cached versions of the css.
117
  * made no noticable attempts at overthrowing governments, but I did post something on facebook about Donald Trump which made some waves.