Custom Facebook Feed - Version 1.9.7

Version Description

  • Fix: Fixed an issue with a generic function name which was occasionally causing an error
Download this release

Release Info

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

Code changes from version 1.9.6 to 1.9.7

Files changed (2) hide show
  1. README.txt +4 -1
  2. custom-facebook-feed.php +10 -10
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
6
- Stable tag: 1.9.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -269,6 +269,9 @@ 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.6 =
273
  * Tweak: Added an HTML wrapper element around the feed
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
6
+ Stable tag: 1.9.7
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.7 =
273
+ * Fix: Fixed an issue with a generic function name which was occasionally causing an error
274
+
275
  = 1.9.6 =
276
  * Tweak: Added an HTML wrapper element around the feed
277
 
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.6
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -808,7 +808,7 @@ function display_cff($atts) {
808
  $cff_html_check_array = array('<', '’', '“', '"', '&');
809
 
810
  //always use the text replace method
811
- if( stripos_arr($post_text, $cff_html_check_array) !== false ) {
812
  //Loop through the tags
813
  foreach($text_tags as $message_tag ) {
814
  $tag_name = $message_tag[0]->name;
@@ -824,7 +824,7 @@ function display_cff($atts) {
824
  $i = 0;
825
  foreach($text_tags as $message_tag ) {
826
  $i++;
827
- $message_tags_arr = array_push_assoc(
828
  $message_tags_arr,
829
  $i,
830
  array(
@@ -843,7 +843,7 @@ function display_cff($atts) {
843
  $c = $message_tags_arr[$i]['offset'];
844
  $d = $message_tags_arr[$i]['length'];
845
 
846
- $post_text = mb_substr_replace( $post_text, $b, $c, $d);
847
 
848
  }
849
 
@@ -1049,7 +1049,7 @@ function display_cff($atts) {
1049
  if ($cff_post_type == 'status') $cff_post_item .= 'cff-status-post';
1050
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1051
  if ($cff_album) $cff_post_item .= ' cff-album';
1052
- $cff_post_item .= ' author-'. to_slug($news->from->name) .'" id="'. $news->id .'" ' . $cff_item_styles . '>';
1053
 
1054
  //POST AUTHOR
1055
  if($cff_show_author) $cff_post_item .= $cff_author;
@@ -1072,7 +1072,7 @@ function display_cff($atts) {
1072
  $cff_post_item .= '</div>';
1073
 
1074
  //PUSH TO ARRAY
1075
- $cff_posts_array = array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1076
 
1077
  } // End post type check
1078
 
@@ -1443,14 +1443,14 @@ if(!is_callable('stripos')){
1443
  return strpos($haystack, stristr( $haystack, $needle ));
1444
  }
1445
  }
1446
- function stripos_arr($haystack, $needle) {
1447
  if(!is_array($needle)) $needle = array($needle);
1448
  foreach($needle as $what) {
1449
  if(($pos = stripos($haystack, ltrim($what) ))!==false) return $pos;
1450
  }
1451
  return false;
1452
  }
1453
- function mb_substr_replace($string, $replacement, $start, $length=NULL) {
1454
  if (is_array($string)) {
1455
  $num = count($string);
1456
  // $replacement
@@ -1487,12 +1487,12 @@ function mb_substr_replace($string, $replacement, $start, $length=NULL) {
1487
  }
1488
 
1489
  //Push to assoc array
1490
- function array_push_assoc($array, $key, $value){
1491
  $array[$key] = $value;
1492
  return $array;
1493
  }
1494
  //Convert string to slug
1495
- function to_slug($string){
1496
  return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string)));
1497
  }
1498
 
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.7
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
808
  $cff_html_check_array = array('&lt;', '’', '“', '&quot;', '&amp;');
809
 
810
  //always use the text replace method
811
+ if( cff_stripos_arr($post_text, $cff_html_check_array) !== false ) {
812
  //Loop through the tags
813
  foreach($text_tags as $message_tag ) {
814
  $tag_name = $message_tag[0]->name;
824
  $i = 0;
825
  foreach($text_tags as $message_tag ) {
826
  $i++;
827
+ $message_tags_arr = cff_array_push_assoc(
828
  $message_tags_arr,
829
  $i,
830
  array(
843
  $c = $message_tags_arr[$i]['offset'];
844
  $d = $message_tags_arr[$i]['length'];
845
 
846
+ $post_text = cff_mb_substr_replace( $post_text, $b, $c, $d);
847
 
848
  }
849
 
1049
  if ($cff_post_type == 'status') $cff_post_item .= 'cff-status-post';
1050
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1051
  if ($cff_album) $cff_post_item .= ' cff-album';
1052
+ $cff_post_item .= ' author-'. cff_to_slug($news->from->name) .'" id="'. $news->id .'" ' . $cff_item_styles . '>';
1053
 
1054
  //POST AUTHOR
1055
  if($cff_show_author) $cff_post_item .= $cff_author;
1072
  $cff_post_item .= '</div>';
1073
 
1074
  //PUSH TO ARRAY
1075
+ $cff_posts_array = cff_array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1076
 
1077
  } // End post type check
1078
 
1443
  return strpos($haystack, stristr( $haystack, $needle ));
1444
  }
1445
  }
1446
+ function cff_stripos_arr($haystack, $needle) {
1447
  if(!is_array($needle)) $needle = array($needle);
1448
  foreach($needle as $what) {
1449
  if(($pos = stripos($haystack, ltrim($what) ))!==false) return $pos;
1450
  }
1451
  return false;
1452
  }
1453
+ function cff_mb_substr_replace($string, $replacement, $start, $length=NULL) {
1454
  if (is_array($string)) {
1455
  $num = count($string);
1456
  // $replacement
1487
  }
1488
 
1489
  //Push to assoc array
1490
+ function cff_array_push_assoc($array, $key, $value){
1491
  $array[$key] = $value;
1492
  return $array;
1493
  }
1494
  //Convert string to slug
1495
+ function cff_to_slug($string){
1496
  return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string)));
1497
  }
1498