Custom Facebook Feed - Version 2.4.4

Version Description

  • New: If your Facebook posts have been created in more than one language on Facebook then it's now possible to display each language by using the locale setting in the shortcode. Eg: English: [custom-facebook-feed locale=en_EN], German: [custom-facebook-feed locale=de_DE]
  • Fix: Fixed an issue with the order of group posts in some feeds
Download this release

Release Info

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

Code changes from version 2.4.3 to 2.4.4

Files changed (2) hide show
  1. README.txt +5 -1
  2. custom-facebook-feed.php +13 -12
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 fans, Facebook likes, Facebook followers, Face book, Facebook pages, Facebook Like Box, Facebook plugin, Facebook walls, custom, customizable, seo, responsive, mobile, social media
4
Requires at least: 3.0
5
Tested up to: 4.6
6
- Stable tag: 2.4.3
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -361,6 +361,10 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
361
9. It's super easy to display your Facebook feed in any page or post
362
363
== Changelog ==
364
= 2.4.3 =
365
* Fix: Fixed a potential security vulnerability
366
* Tested with upcoming WordPress 4.6 update
3
Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook fans, Facebook likes, Facebook followers, Face book, Facebook pages, Facebook Like Box, Facebook plugin, Facebook walls, custom, customizable, seo, responsive, mobile, social media
4
Requires at least: 3.0
5
Tested up to: 4.6
6
+ Stable tag: 2.4.4
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
361
9. It's super easy to display your Facebook feed in any page or post
362
363
== Changelog ==
364
+ = 2.4.4 =
365
+ * New: If your Facebook posts have been created in more than one language on Facebook then it's now possible to display each language by using the `locale` setting in the shortcode. Eg: English: `[custom-facebook-feed locale=en_EN]`, German: `[custom-facebook-feed locale=de_DE]`
366
+ * Fix: Fixed an issue with the order of group posts in some feeds
367
+
368
= 2.4.3 =
369
* Fix: Fixed a potential security vulnerability
370
* Tested with upcoming WordPress 4.6 update
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 completely customizable Facebook feeds to your WordPress site
6
- Version: 2.4.3
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
@@ -24,7 +24,7 @@ along with this program; if not, write to the Free Software
24
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
*/
26
27
- define('CFFVER', '2.4.3');
28
29
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
//Include admin
@@ -836,7 +836,7 @@ function display_cff($atts) {
836
//Add like box to the inside of the top of feed
837
if ($cff_like_box_position == 'top' && $cff_show_like_box && !$cff_like_box_outside) $cff_content .= $like_box;
838
//Limit var
839
- $i = 0;
840
841
//Define array for post items
842
$cff_posts_array = array();
@@ -851,8 +851,9 @@ function display_cff($atts) {
851
852
//Create the transient name
853
//Split the Page ID in half and stick it together so we definitely have the beginning and end of it
854
- $trans_page_id = substr($page_id, 0, 17) . substr($page_id, -16);
855
- $transient_name = 'cff_' . substr($graph_query, 0, 1) . '_' . $trans_page_id . substr($cff_post_limit, 0, 3) . substr($show_posts_by, 0, 2);
856
//Limit to 45 chars max
857
$transient_name = substr($transient_name, 0, 45);
858
@@ -976,10 +977,10 @@ function display_cff($atts) {
976
977
if ( ($prev_post_message == $pm) && ($prev_post_link == $pl) && ($prev_post_description == $pd) ) $cff_show_post = false;
978
979
- //Offset. If the post index ($i) is less than the offset then don't show the post
980
- if( intval($i) < intval($atts['offset']) ){
981
$cff_show_post = false;
982
- $i++;
983
}
984
985
//Check post type and display post if selected
@@ -988,12 +989,12 @@ function display_cff($atts) {
988
//Only create posts for the amount of posts specified
989
if( intval($atts['offset']) > 0 ){
990
//If offset is being used then stop after showing the number of posts + the offset
991
- if ( $i == (intval($show_posts) + intval($atts['offset'])) ) break;
992
} else {
993
//Else just stop after the number of posts to be displayed is reached
994
- if ( $i == $show_posts ) break;
995
}
996
- $i++;
997
//********************************//
998
//***COMPILE SECTION VARIABLES***//
999
//********************************//
@@ -1536,7 +1537,7 @@ function display_cff($atts) {
1536
if(!$cff_is_group){
1537
$cff_posts_array = cff_array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1538
} else {
1539
- $cff_posts_array = cff_array_push_assoc($cff_posts_array, $i, $cff_post_item);
1540
}
1541
1542
} // End post type check
3
Plugin Name: Custom Facebook Feed
4
Plugin URI: http://smashballoon.com/custom-facebook-feed
5
Description: Add completely customizable Facebook feeds to your WordPress site
6
+ Version: 2.4.4
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
24
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
*/
26
27
+ define('CFFVER', '2.4.4');
28
29
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
//Include admin
836
//Add like box to the inside of the top of feed
837
if ($cff_like_box_position == 'top' && $cff_show_like_box && !$cff_like_box_outside) $cff_content .= $like_box;
838
//Limit var
839
+ $i_post = 0;
840
841
//Define array for post items
842
$cff_posts_array = array();
851
852
//Create the transient name
853
//Split the Page ID in half and stick it together so we definitely have the beginning and end of it
854
+ $trans_page_id = substr($page_id, 0, 16) . substr($page_id, -15);
855
+ $transient_name = 'cff_' . substr($graph_query, 0, 1) . '_' . $trans_page_id . substr($cff_post_limit, 0, 3) . substr($show_posts_by, 0, 2) . substr($cff_locale, 0, 2);
856
+
857
//Limit to 45 chars max
858
$transient_name = substr($transient_name, 0, 45);
859
977
978
if ( ($prev_post_message == $pm) && ($prev_post_link == $pl) && ($prev_post_description == $pd) ) $cff_show_post = false;
979
980
+ //Offset. If the post index ($i_post) is less than the offset then don't show the post
981
+ if( intval($i_post) < intval($atts['offset']) ){
982
$cff_show_post = false;
983
+ $i_post++;
984
}
985
986
//Check post type and display post if selected
989
//Only create posts for the amount of posts specified
990
if( intval($atts['offset']) > 0 ){
991
//If offset is being used then stop after showing the number of posts + the offset
992
+ if ( $i_post == (intval($show_posts) + intval($atts['offset'])) ) break;
993
} else {
994
//Else just stop after the number of posts to be displayed is reached
995
+ if ( $i_post == $show_posts ) break;
996
}
997
+ $i_post++;
998
//********************************//
999
//***COMPILE SECTION VARIABLES***//
1000
//********************************//
1537
if(!$cff_is_group){
1538
$cff_posts_array = cff_array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1539
} else {
1540
+ $cff_posts_array = cff_array_push_assoc($cff_posts_array, $i_post, $cff_post_item);
1541
}
1542
1543
} // End post type check