Custom Facebook Feed - Version 1.9.9.3

Version Description

  • New: Hashtags in link, photo and video descriptions are now also linked
  • Fix: Fixed an issue with hashtags being linked when the post text is also linked, which interfered with the text formatting
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 1.9.9.3
Comparing to
See all releases

Code changes from version 1.9.9.2 to 1.9.9.3

Files changed (4) hide show
  1. README.txt +5 -1
  2. custom-facebook-feed.php +10 -1
  3. img/pro.png +0 -0
  4. js/cff-scripts.js +4 -0
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social
4
  Requires at least: 3.0
5
  Tested up to: 3.9.1
6
- Stable tag: 1.9.9.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -269,6 +269,10 @@ Credit [iMarketing Factory](http://www.imarketingfactory.com/facebook/ "The Impo
269
  9. It's super easy to display your Facebook feed in any page or post
270
 
271
  == Changelog ==
 
 
 
 
272
  = 1.9.9.2 =
273
  * Fix: Removed a couple of stray PHP notices
274
 
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social
4
  Requires at least: 3.0
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.9.9.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
269
  9. It's super easy to display your Facebook feed in any page or post
270
 
271
  == Changelog ==
272
+ = 1.9.9.3 =
273
+ * New: Hashtags in link, photo and video descriptions are now also linked
274
+ * Fix: Fixed an issue with hashtags being linked when the post text is also linked, which interfered with the text formatting
275
+
276
  = 1.9.9.2 =
277
  * Fix: Removed a couple of stray PHP notices
278
 
custom-facebook-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
- Version: 1.9.9.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -1141,6 +1141,7 @@ function display_cff($atts) {
1141
  if ($ajax_theme) {
1142
  $cff_link_hashtags = $atts['linkhashtags'];
1143
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
 
1144
  $cff_content .= '<script type="text/javascript">var cfflinkhashtags = "' . $cff_link_hashtags . '";</script>';
1145
  $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
1146
  }
@@ -1618,9 +1619,17 @@ add_action( 'wp_footer', 'cff_js' );
1618
  function cff_js() {
1619
  $options = get_option('cff_style_settings');
1620
  $cff_custom_js = isset($options[ 'cff_custom_js' ]) ? $options[ 'cff_custom_js' ] : '';
 
 
1621
  isset($options[ 'cff_link_hashtags' ]) ? $cff_link_hashtags = $options[ 'cff_link_hashtags' ] : $cff_link_hashtags = 'true';
1622
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1623
 
 
 
 
 
 
 
1624
  echo '<!-- Custom Facebook Feed JS -->';
1625
  echo "\r\n";
1626
  echo '<script type="text/javascript">';
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
+ Version: 1.9.9.3
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
1141
  if ($ajax_theme) {
1142
  $cff_link_hashtags = $atts['linkhashtags'];
1143
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1144
+ if ($cff_title_link) $cff_link_hashtags = 'false';
1145
  $cff_content .= '<script type="text/javascript">var cfflinkhashtags = "' . $cff_link_hashtags . '";</script>';
1146
  $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
1147
  }
1619
  function cff_js() {
1620
  $options = get_option('cff_style_settings');
1621
  $cff_custom_js = isset($options[ 'cff_custom_js' ]) ? $options[ 'cff_custom_js' ] : '';
1622
+
1623
+ //Link hashtags?
1624
  isset($options[ 'cff_link_hashtags' ]) ? $cff_link_hashtags = $options[ 'cff_link_hashtags' ] : $cff_link_hashtags = 'true';
1625
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1626
 
1627
+ //If linking the post text then don't link the hashtags
1628
+ isset($options[ 'cff_title_link' ]) ? $cff_title_link = $options[ 'cff_title_link' ] : $cff_title_link = false;
1629
+ ($cff_title_link == 'true' || $cff_title_link == 'on') ? $cff_title_link = true : $cff_title_link = false;
1630
+ if ($cff_title_link) $cff_link_hashtags = 'false';
1631
+
1632
+
1633
  echo '<!-- Custom Facebook Feed JS -->';
1634
  echo "\r\n";
1635
  echo '<script type="text/javascript">';
img/pro.png CHANGED
Binary file
js/cff-scripts.js CHANGED
@@ -59,6 +59,7 @@ jQuery(document).ready(function() {
59
  //Link hashtags
60
  if(cfflinkhashtags == 'true'){
61
  var str = $self.find('.cff-text').html(),
 
62
  regex = /(?:\s|^)(?:#(?!\d+(?:\s|$)))(\w+)(?=\s|$)/gi,
63
  linkcolor = $self.find('.cff-text').attr('rel');
64
 
@@ -66,7 +67,10 @@ jQuery(document).ready(function() {
66
  var replacementString = jQuery.trim(hash);
67
  return ' <a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" style="color: #' + linkcolor + '">' + replacementString + '</a>';
68
  }
 
69
  $self.find('.cff-text').html( str.replace( regex , replacer ) );
 
 
70
  }
71
 
72
  });
59
  //Link hashtags
60
  if(cfflinkhashtags == 'true'){
61
  var str = $self.find('.cff-text').html(),
62
+ descstr = $self.find('.cff-post-desc').html(),
63
  regex = /(?:\s|^)(?:#(?!\d+(?:\s|$)))(\w+)(?=\s|$)/gi,
64
  linkcolor = $self.find('.cff-text').attr('rel');
65
 
67
  var replacementString = jQuery.trim(hash);
68
  return ' <a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" style="color: #' + linkcolor + '">' + replacementString + '</a>';
69
  }
70
+ //Replace hashtags in text
71
  $self.find('.cff-text').html( str.replace( regex , replacer ) );
72
+ //Replace hashtags in desc
73
+ if( $self.find('.cff-post-desc').length ) $self.find('.cff-post-desc').html( descstr.replace( regex , replacer ) );
74
  }
75
 
76
  });