Custom Twitter Feeds - Version 1.3

Version Description

  • New: You can now choose to only display a certain amount of text characters in your Tweets, with a clickable link to display the rest. This is set to be 280 characters by default, but can be changed by using the following setting: Customize > Style > Tweet Text > Text Length, or by using the "textlength" shortcode setting.
  • Tweak: Twitter intents JavaScript not loaded on the page if tweet actions are removed
  • Fix: Removed target="_blank" from div element
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Twitter Feeds
Version 1.3
Comparing to
See all releases

Code changes from version 1.2.11 to 1.3

README.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: smashballoon, craig-at-smash-balloon
4
  Support Website: http://smashballoon/custom-twitter-feeds/
5
  Tags: Twitter, Twitter feed, Tweets, Twitter widget, Custom Twitter Feed
6
  Requires at least: 3.0
7
- Tested up to: 5.1
8
- Stable tag: 1.2.11
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -237,6 +237,11 @@ Not many developers love providing support, but we're a rare breed here at Smash
237
  7. To display a feed just copy and paste the shortcode into a widget or page
238
 
239
  == Changelog ==
 
 
 
 
 
240
  = 1.2.11 =
241
  * Fix: Quoted tweets would not display if saving settings on the "Customize tab". After updating, Enable "Quoted tweet box" in the "Show/Hide" section to display quoted tweets
242
  * Fix: Fixed PHP warning caused by trying to count a boolean in certain circumstances
4
  Support Website: http://smashballoon/custom-twitter-feeds/
5
  Tags: Twitter, Twitter feed, Tweets, Twitter widget, Custom Twitter Feed
6
  Requires at least: 3.0
7
+ Tested up to: 5.2
8
+ Stable tag: 1.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
237
  7. To display a feed just copy and paste the shortcode into a widget or page
238
 
239
  == Changelog ==
240
+ = 1.3 =
241
+ * New: You can now choose to only display a certain amount of text characters in your Tweets, with a clickable link to display the rest. This is set to be 280 characters by default, but can be changed by using the following setting: Customize > Style > Tweet Text > Text Length, or by using the "textlength" shortcode setting.
242
+ * Tweak: Twitter intents JavaScript not loaded on the page if tweet actions are removed
243
+ * Fix: Removed target="_blank" from div element
244
+
245
  = 1.2.11 =
246
  * Fix: Quoted tweets would not display if saving settings on the "Customize tab". After updating, Enable "Quoted tweet box" in the "Show/Hide" section to display quoted tweets
247
  * Fix: Fixed PHP warning caused by trying to count a boolean in certain circumstances
css/ctf-styles.css CHANGED
@@ -13,6 +13,22 @@
13
  #ctf .ctf-item:first-child{
14
  border-top: none;
15
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  /* Header */
18
  #ctf .ctf-header{
13
  #ctf .ctf-item:first-child{
14
  border-top: none;
15
  }
16
+ #ctf .ctf_remaining {
17
+ display: none;
18
+ }
19
+ #ctf .ctf_more{
20
+ padding: 1px;
21
+ border: 1px solid transparent;
22
+ border-radius: 3px;
23
+ display: inline-block;
24
+ line-height: 1;
25
+ }
26
+ #ctf .ctf_more:hover {
27
+ cursor: pointer;
28
+ background: rgba(0,0,0,0.05);
29
+ border: 1px solid rgba(0,0,0,0.1);
30
+ text-decoration: none;
31
+ }
32
 
33
  /* Header */
34
  #ctf .ctf-header{
custom-twitter-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Twitter Feeds
4
  Plugin URI: http://smashballoon.com/custom-twitter-feeds
5
  Description: Customizable Twitter feeds for your website
6
- Version: 1.2.11
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  Text Domain: custom-twitter-feeds
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
 
26
  define( 'CTF_URL', plugin_dir_path( __FILE__ ) );
27
- define( 'CTF_VERSION', '1.2.11' );
28
  define( 'CTF_TITLE', 'Custom Twitter Feeds' );
29
  define( 'CTF_JS_URL', plugins_url( '/js/ctf-scripts.js?ver=' . CTF_VERSION , __FILE__ ) );
30
  define( 'OAUTH_PROCESSOR_URL', 'https://api.smashballoon.com/twitter-login.php?return_uri=' );
@@ -226,6 +226,68 @@ function ctf_get_formatted_date( $raw_date, $feed_options, $utc_offset ) {
226
  return $date_str;
227
  }
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Called via ajax to automatically save access token and access token secret
231
  * retrieved with the big blue button
@@ -333,7 +395,7 @@ function ctf_scripts_and_styles() {
333
  $not_ajax_theme = (! isset( $options['ajax_theme'] ) || ! $options['ajax_theme']);
334
 
335
  wp_enqueue_style( 'ctf_styles', plugins_url( '/css/ctf-styles.css', __FILE__ ), array(), CTF_VERSION );
336
- wp_enqueue_script( 'ctf_twitter_intents', 'https://platform.twitter.com/widgets.js' );
337
 
338
  if ( $not_ajax_theme ) {
339
  wp_enqueue_script( 'ctf_scripts', plugins_url( '/js/ctf-scripts.js', __FILE__ ), array( 'jquery' ), CTF_VERSION, true );
3
  Plugin Name: Custom Twitter Feeds
4
  Plugin URI: http://smashballoon.com/custom-twitter-feeds
5
  Description: Customizable Twitter feeds for your website
6
+ Version: 1.3
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  Text Domain: custom-twitter-feeds
24
  */
25
 
26
  define( 'CTF_URL', plugin_dir_path( __FILE__ ) );
27
+ define( 'CTF_VERSION', '1.3' );
28
  define( 'CTF_TITLE', 'Custom Twitter Feeds' );
29
  define( 'CTF_JS_URL', plugins_url( '/js/ctf-scripts.js?ver=' . CTF_VERSION , __FILE__ ) );
30
  define( 'OAUTH_PROCESSOR_URL', 'https://api.smashballoon.com/twitter-login.php?return_uri=' );
226
  return $date_str;
227
  }
228
 
229
+ function ctf_maybe_shorten_text( $string, $feed_settings ) {
230
+ $limit = $feed_settings['textlength'];
231
+ if ( strlen( $string ) <= $limit || $limit == 280 ) {
232
+ return $string;
233
+ }
234
+ $parts = preg_split( '/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE );
235
+ $parts_count = count( $parts );
236
+ $length = 0;
237
+ $last_part = 0;
238
+ for ( ; $last_part < $parts_count; ++$last_part ) {
239
+ $length += strlen( $parts[ $last_part ] );
240
+ if ( $length > $limit ) { break; }
241
+ }
242
+ $last_part = $last_part !== 0 ? $last_part - 1 : 0;
243
+ $parts[ $last_part ] = $parts[ $last_part ] . '<a href="#" class="ctf_more">...</a><span class="ctf_remaining">';
244
+ $return = implode( ' ', $parts ).'</span>';
245
+ return $return;
246
+ }
247
+ add_filter( 'ctf_tweet_text', 'ctf_maybe_shorten_text', 10, 2 );
248
+
249
+ function ctf_get_fa_el( $icon ) {
250
+ $options = get_option( 'ctf_options' );
251
+ $font_method = isset( $options['font_method'] ) ? $options['font_method'] : 'svg';
252
+
253
+ $elems = array(
254
+ 'fa-arrows-alt' => array(
255
+ 'icon' => '<i class="fa fa-arrows-alt"></i>',
256
+ 'svg' => '<svg class="svg-inline--fa fa-arrows-alt fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="arrows-alt" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"></path></svg>'
257
+ ),
258
+ 'fa-check-circle' => array(
259
+ 'icon' => '<i class="fa fa-check-circle"></i>',
260
+ 'svg' => '<svg class="svg-inline--fa fa-check-circle fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>'
261
+ ),
262
+ 'fa-reply' => array(
263
+ 'icon' => '<i class="fa fa-reply"></i>',
264
+ 'svg' => '<svg class="svg-inline--fa fa-reply fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="reply" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M8.309 189.836L184.313 37.851C199.719 24.546 224 35.347 224 56.015v80.053c160.629 1.839 288 34.032 288 186.258 0 61.441-39.581 122.309-83.333 154.132-13.653 9.931-33.111-2.533-28.077-18.631 45.344-145.012-21.507-183.51-176.59-185.742V360c0 20.7-24.3 31.453-39.687 18.164l-176.004-152c-11.071-9.562-11.086-26.753 0-36.328z"></path></svg>'
265
+ ),
266
+ 'fa-retweet' => array(
267
+ 'icon' => '<i class="fa fa-retweet"></i>',
268
+ 'svg' => '<svg class="svg-inline--fa fa-retweet fa-w-20" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="retweet" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M629.657 343.598L528.971 444.284c-9.373 9.372-24.568 9.372-33.941 0L394.343 343.598c-9.373-9.373-9.373-24.569 0-33.941l10.823-10.823c9.562-9.562 25.133-9.34 34.419.492L480 342.118V160H292.451a24.005 24.005 0 0 1-16.971-7.029l-16-16C244.361 121.851 255.069 96 276.451 96H520c13.255 0 24 10.745 24 24v222.118l40.416-42.792c9.285-9.831 24.856-10.054 34.419-.492l10.823 10.823c9.372 9.372 9.372 24.569-.001 33.941zm-265.138 15.431A23.999 23.999 0 0 0 347.548 352H160V169.881l40.416 42.792c9.286 9.831 24.856 10.054 34.419.491l10.822-10.822c9.373-9.373 9.373-24.569 0-33.941L144.971 67.716c-9.373-9.373-24.569-9.373-33.941 0L10.343 168.402c-9.373 9.373-9.373 24.569 0 33.941l10.822 10.822c9.562 9.562 25.133 9.34 34.419-.491L96 169.881V392c0 13.255 10.745 24 24 24h243.549c21.382 0 32.09-25.851 16.971-40.971l-16.001-16z"></path></svg>'
269
+ ),
270
+ 'fa-heart' => array(
271
+ 'icon' => '<i class="fa fa-heart"></i>',
272
+ 'svg' => '<svg class="svg-inline--fa fa-heart fa-w-18" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="heart" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M414.9 24C361.8 24 312 65.7 288 89.3 264 65.7 214.2 24 161.1 24 70.3 24 16 76.9 16 165.5c0 72.6 66.8 133.3 69.2 135.4l187 180.8c8.8 8.5 22.8 8.5 31.6 0l186.7-180.2c2.7-2.7 69.5-63.5 69.5-136C560 76.9 505.7 24 414.9 24z"></path></svg>'
273
+ ),
274
+ 'fa-twitter' => array(
275
+ 'icon' => '<i class="fa fab fa-twitter"></i>',
276
+ 'svg' => '<svg class="svg-inline--fa fa-twitter fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>'
277
+ ),
278
+ 'fa-user' => array(
279
+ 'icon' => '<i class="fa fa-user"></i>',
280
+ 'svg' => '<svg class="svg-inline--fa fa-user fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="user" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M96 160C96 71.634 167.635 0 256 0s160 71.634 160 160-71.635 160-160 160S96 248.366 96 160zm304 192h-28.556c-71.006 42.713-159.912 42.695-230.888 0H112C50.144 352 0 402.144 0 464v24c0 13.255 10.745 24 24 24h464c13.255 0 24-10.745 24-24v-24c0-61.856-50.144-112-112-112z"></path></svg>'
281
+ ),
282
+ 'ctf_playbtn' => array(
283
+ 'icon' => '',
284
+ 'svg' => '<svg style="color: rgba(255,255,255,1)" class="svg-inline--fa fa-play fa-w-14 ctf_playbtn" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>'
285
+ )
286
+ );
287
+
288
+ return $elems[ $icon ]['icon'];
289
+ }
290
+
291
  /**
292
  * Called via ajax to automatically save access token and access token secret
293
  * retrieved with the big blue button
395
  $not_ajax_theme = (! isset( $options['ajax_theme'] ) || ! $options['ajax_theme']);
396
 
397
  wp_enqueue_style( 'ctf_styles', plugins_url( '/css/ctf-styles.css', __FILE__ ), array(), CTF_VERSION );
398
+ wp_enqueue_script( 'ctf_twitter_intents', 'https://platform.twitter.com/widgets.js', array(), CTF_VERSION, true );
399
 
400
  if ( $not_ajax_theme ) {
401
  wp_enqueue_script( 'ctf_scripts', plugins_url( '/js/ctf-scripts.js', __FILE__ ), array( 'jquery' ), CTF_VERSION, true );
inc/CtfAdmin.php CHANGED
@@ -831,6 +831,24 @@ class CtfAdmin
831
  'class' => '',
832
  ));
833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
  // custom retweeted text
835
  $this->create_settings_field( array(
836
  'name' => 'retweetedtext',
831
  'class' => '',
832
  ));
833
 
834
+ $this->create_settings_field( array(
835
+ 'name' => 'textlength',
836
+ 'title' => '<label for="ctf_textlength">Text Length</label><code class="ctf_shortcode">textlength
837
+ Eg: textlength=150</code>', // label for the input field
838
+ 'callback' => 'default_text', // name of the function that outputs the html
839
+ 'page' => 'ctf_options_text', // matches the section name
840
+ 'section' => 'ctf_options_text', // matches the section name
841
+ 'option' => 'ctf_options', // matches the options name
842
+ 'class' => '',
843
+ 'default' => 280,
844
+ 'min' => 20,
845
+ 'max' => 280,
846
+ 'step' => 1,
847
+ 'example' => 'characters',
848
+ 'type' => 'number',
849
+ 'whatis' => 'The number of characters of text to display in the tweet text. An ellipsis link will be added to allow the user to reveal more text if desired',
850
+ ));
851
+
852
  // custom retweeted text
853
  $this->create_settings_field( array(
854
  'name' => 'retweetedtext',
inc/CtfFeed.php CHANGED
@@ -161,7 +161,7 @@ class CtfFeed
161
  $this->setStandardTextOptions( 'twitterlinktext', 'Twitter' );
162
 
163
  $this->setStandardTextOptions( 'buttontext', __( 'Load More...', 'custom-twitter-feeds' ) );
164
-
165
  $text_size = array(
166
  'authortextsize',
167
  'tweettextsize',
@@ -1242,6 +1242,11 @@ class CtfFeed
1242
  $feed_options = $this->feed_options;
1243
  $tweet_html = $this->feed_html;
1244
 
 
 
 
 
 
1245
  if ( $is_pagination && ( ! isset ( $tweet_set[1]['id_str'] ) ) ) {
1246
  $tweet_html .= $this->getOutOfTweetsHtml( $this->feed_options );
1247
  } else {
@@ -1345,7 +1350,7 @@ class CtfFeed
1345
  if ( ctf_show( 'avatar', $feed_options ) || ctf_show( 'author', $feed_options ) || ctf_show( 'date', $feed_options ) ) {
1346
 
1347
  $tweet_html .= '<div class="ctf-author-box">';
1348
- $tweet_html .= '<div class="ctf-author-box-link" target="_blank" style="' . $feed_options['authortextsize'] . $feed_options['authortextweight'] . $feed_options['textcolor'] . '">';
1349
  if ( ctf_show( 'avatar', $feed_options ) ) {
1350
  $tweet_html .= '<a href="https://twitter.com/' . $post['user']['screen_name'] . '" class="ctf-author-avatar" target="_blank" style="' . $feed_options['authortextsize'] . $feed_options['authortextweight'] . $feed_options['textcolor'] . '">';
1351
  $tweet_html .= '<img src="' . $post['user']['profile_image_url_https'] . '" alt="' . $post['user']['screen_name'] . '" width="48" height="48">';
@@ -1373,14 +1378,16 @@ class CtfFeed
1373
 
1374
 
1375
  if ( ctf_show( 'text', $feed_options ) ) {
 
 
1376
  $tweet_html .= '<div class="ctf-tweet-content">';
1377
 
1378
  if ( $feed_options['linktexttotwitter'] ) {
1379
  $tweet_html .= '<a href="https://twitter.com/' .$post['user']['screen_name'] . '/status/' . $post['id_str'] . '" target="_blank">';
1380
- $tweet_html .= '<p class="ctf-tweet-text" style="' . $feed_options['tweettextsize'] . $feed_options['tweettextweight'] . $feed_options['textcolor'] . '">' . nl2br( $post['text'] ) . $post_media_text .'</p>';
1381
  $tweet_html .= '</a>';
1382
  } else {
1383
- $tweet_html .= '<p class="ctf-tweet-text" style="' . $feed_options['tweettextsize'] . $feed_options['tweettextweight'] . $feed_options['textcolor'] . '">' . nl2br( $post['text'] );
1384
 
1385
  if( $post_media_count > 0 ){
1386
  if ( $feed_options['disablelinks'] ) {
@@ -1410,20 +1417,20 @@ class CtfFeed
1410
 
1411
  $tweet_html .= '<div class="ctf-tweet-actions">';
1412
  if ( ctf_show( 'actions', $feed_options ) ) {
1413
- $tweet_html .= '<a href="https://twitter.com/intent/tweet?in_reply_to=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-reply" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '"><i class="fa fa-reply" aria-hidden="true"></i><span class="ctf-screenreader">'.__( 'Reply on Twitter', 'custom-twitter-feeds' ).'</span></a>';
1414
- $tweet_html .= '<a href="https://twitter.com/intent/retweet?tweet_id=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-retweet" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '"><i class="fa fa-retweet" aria-hidden="true"></i><span class="ctf-screenreader">'.__( 'Retweet on Twitter', 'custom-twitter-feeds' ).'</span><span class="ctf-action-count ctf-retweet-count">';
1415
  if ( $post['retweet_count'] > 0 ) {
1416
  $tweet_html .= $post['retweet_count'];
1417
  }
1418
  $tweet_html .= '</span></a>';
1419
- $tweet_html .= '<a href="https://twitter.com/intent/like?tweet_id=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-like" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '"><i class="fa fa-heart" aria-hidden="true"></i><span class="ctf-screenreader">'.__( 'Like on Twitter', 'custom-twitter-feeds' ).'</span><span class="ctf-action-count ctf-favorite-count">';
1420
  if ( $post['favorite_count'] > 0 ) {
1421
  $tweet_html .= $post['favorite_count'];
1422
  }
1423
  $tweet_html .= '</span></a>';
1424
  }
1425
  if ( ctf_show( 'twitterlink', $feed_options ) ) {
1426
- $tweet_html .= '<a href="https://twitter.com/' .$post['user']['screen_name'] . '/status/' . $post['id_str'] . '" class="ctf-twitterlink" style="' . $feed_options['textcolor'] . '" target="_blank">' . $feed_options['twitterlinktext'] . '</a>';
1427
  } // show twitter link or actions
1428
  $tweet_html .= '</div>';
1429
  $tweet_html .= '</div>';
161
  $this->setStandardTextOptions( 'twitterlinktext', 'Twitter' );
162
 
163
  $this->setStandardTextOptions( 'buttontext', __( 'Load More...', 'custom-twitter-feeds' ) );
164
+ $this->setStandardTextOptions( 'textlength', 280 );
165
  $text_size = array(
166
  'authortextsize',
167
  'tweettextsize',
1242
  $feed_options = $this->feed_options;
1243
  $tweet_html = $this->feed_html;
1244
 
1245
+ // dequeue intents if not being used
1246
+ if ( ! ctf_show( 'actions', $feed_options ) ) {
1247
+ wp_dequeue_script( 'ctf_twitter_intents' );
1248
+ }
1249
+
1250
  if ( $is_pagination && ( ! isset ( $tweet_set[1]['id_str'] ) ) ) {
1251
  $tweet_html .= $this->getOutOfTweetsHtml( $this->feed_options );
1252
  } else {
1350
  if ( ctf_show( 'avatar', $feed_options ) || ctf_show( 'author', $feed_options ) || ctf_show( 'date', $feed_options ) ) {
1351
 
1352
  $tweet_html .= '<div class="ctf-author-box">';
1353
+ $tweet_html .= '<div class="ctf-author-box-link" style="' . $feed_options['authortextsize'] . $feed_options['authortextweight'] . $feed_options['textcolor'] . '">';
1354
  if ( ctf_show( 'avatar', $feed_options ) ) {
1355
  $tweet_html .= '<a href="https://twitter.com/' . $post['user']['screen_name'] . '" class="ctf-author-avatar" target="_blank" style="' . $feed_options['authortextsize'] . $feed_options['authortextweight'] . $feed_options['textcolor'] . '">';
1356
  $tweet_html .= '<img src="' . $post['user']['profile_image_url_https'] . '" alt="' . $post['user']['screen_name'] . '" width="48" height="48">';
1378
 
1379
 
1380
  if ( ctf_show( 'text', $feed_options ) ) {
1381
+ $post_text = apply_filters( 'ctf_tweet_text', $post['text'], $feed_options );
1382
+
1383
  $tweet_html .= '<div class="ctf-tweet-content">';
1384
 
1385
  if ( $feed_options['linktexttotwitter'] ) {
1386
  $tweet_html .= '<a href="https://twitter.com/' .$post['user']['screen_name'] . '/status/' . $post['id_str'] . '" target="_blank">';
1387
+ $tweet_html .= '<p class="ctf-tweet-text" style="' . $feed_options['tweettextsize'] . $feed_options['tweettextweight'] . $feed_options['textcolor'] . '">' . nl2br( $post_text ) . $post_media_text .'</p>';
1388
  $tweet_html .= '</a>';
1389
  } else {
1390
+ $tweet_html .= '<p class="ctf-tweet-text" style="' . $feed_options['tweettextsize'] . $feed_options['tweettextweight'] . $feed_options['textcolor'] . '">' . nl2br( $post_text );
1391
 
1392
  if( $post_media_count > 0 ){
1393
  if ( $feed_options['disablelinks'] ) {
1417
 
1418
  $tweet_html .= '<div class="ctf-tweet-actions">';
1419
  if ( ctf_show( 'actions', $feed_options ) ) {
1420
+ $tweet_html .= '<a href="https://twitter.com/intent/tweet?in_reply_to=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-reply" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '">' . ctf_get_fa_el( 'fa-reply' ) . '<span class="ctf-screenreader">Reply on Twitter ' . $post['id_str'] . '</span></a>';
1421
+ $tweet_html .= '<a href="https://twitter.com/intent/retweet?tweet_id=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-retweet" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '">' . ctf_get_fa_el( 'fa-retweet' ) . '<span class="ctf-screenreader">Retweet on Twitter ' . $post['id_str'] . '</span><span class="ctf-action-count ctf-retweet-count">';
1422
  if ( $post['retweet_count'] > 0 ) {
1423
  $tweet_html .= $post['retweet_count'];
1424
  }
1425
  $tweet_html .= '</span></a>';
1426
+ $tweet_html .= '<a href="https://twitter.com/intent/like?tweet_id=' . $post['id_str'] . '&related=' . $post['user']['screen_name'] . '" class="ctf-like" target="_blank" style="' . $feed_options['iconsize'] . $feed_options['iconcolor'] . '">' . ctf_get_fa_el( 'fa-heart' ) . '<span class="ctf-screenreader">Like on Twitter ' . $post['id_str'] . '</span><span class="ctf-action-count ctf-favorite-count">';
1427
  if ( $post['favorite_count'] > 0 ) {
1428
  $tweet_html .= $post['favorite_count'];
1429
  }
1430
  $tweet_html .= '</span></a>';
1431
  }
1432
  if ( ctf_show( 'twitterlink', $feed_options ) ) {
1433
+ $tweet_html .= '<a href="https://twitter.com/' . $post['user']['screen_name'] . '/status/' . $post['id_str'] . '" class="ctf-twitterlink" style="' . $feed_options['textcolor'] . '" target="_blank">' . esc_html( $feed_options['twitterlinktext'] ) . ' <span class="ctf-screenreader">' . $post['id_str'] . '</span></a>';
1434
  } // show twitter link or actions
1435
  $tweet_html .= '</div>';
1436
  $tweet_html .= '</div>';
inc/widget.php CHANGED
@@ -17,7 +17,7 @@ class CtfWidget extends WP_Widget
17
 
18
  public function widget( $args, $instance ) {
19
 
20
- $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
21
  $content = isset( $instance['content'] ) ? strip_tags( $instance['content'] ) : '[custom-twitter-feeds]';
22
 
23
  echo $args['before_widget'];
17
 
18
  public function widget( $args, $instance ) {
19
 
20
+ $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) : '';
21
  $content = isset( $instance['content'] ) ? strip_tags( $instance['content'] ) : '[custom-twitter-feeds]';
22
 
23
  echo $args['before_widget'];
js/ctf-scripts.js CHANGED
@@ -89,6 +89,11 @@ if(!ctf_js_exists){
89
  $ctf.find('.ctf-header .ctf-header-img-hover').stop().fadeOut(600);
90
  });
91
 
 
 
 
 
 
92
  // Call Custom JS if it exists
93
  if (typeof ctf_custom_js == 'function') ctf_custom_js($);
94
 
89
  $ctf.find('.ctf-header .ctf-header-img-hover').stop().fadeOut(600);
90
  });
91
 
92
+ $ctf.find('.ctf_more').unbind('click').bind('click', function(e){
93
+ e.preventDefault();
94
+ $(this).hide().next('.ctf_remaining').show();
95
+ });
96
+
97
  // Call Custom JS if it exists
98
  if (typeof ctf_custom_js == 'function') ctf_custom_js($);
99