Custom Facebook Feed - Version 1.9.9

Version Description

  • New: Hashtags in your posts are now linked to the hashtag search on Facebook. This can be disabled in the 'Post Text' section on the Typography settings page.
  • New: Added a Facebook icon to the Custom Facebook Feed admin menu
  • Fix: Corrected the left side margin on the "Like" box so that it aligns correctly with posts
Download this release

Release Info

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

Code changes from version 1.9.8.1 to 1.9.9

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.8.1
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -269,6 +269,11 @@ 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.8.1 =
273
* Fix: Fixed an admin JavaScript error introduced by the last update
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
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 =
273
+ * New: Hashtags in your posts are now linked to the hashtag search on Facebook. This can be disabled in the 'Post Text' section on the Typography settings page.
274
+ * New: Added a Facebook icon to the Custom Facebook Feed admin menu
275
+ * Fix: Corrected the left side margin on the "Like" box so that it aligns correctly with posts
276
+
277
= 1.9.8.1 =
278
* Fix: Fixed an admin JavaScript error introduced by the last update
279
css/cff-admin-style.css CHANGED
@@ -228,4 +228,9 @@
228
/* Access Token field */
229
#cff-admin .cff-access-token-hidden{
230
display: none;
231
}
228
/* Access Token field */
229
#cff-admin .cff-access-token-hidden{
230
display: none;
231
+ }
232
+
233
+ /* Add Facebook dashicon to CFF admin menu */
234
+ #toplevel_page_cff-top .toplevel_page_cff-top .wp-menu-image:before{
235
+ content: "\f305";
236
}
css/cff-style.css CHANGED
@@ -221,8 +221,8 @@
221
.cff-likebox{
222
float: left;
223
width: 100%;
224
- /*margin-left: -10px;*/
225
position: relative;
226
}
227
.cff-likebox .fb_iframe_widget{
228
width: 100%;
221
.cff-likebox{
222
float: left;
223
width: 100%;
224
position: relative;
225
+ margin-left: -10px;
226
}
227
.cff-likebox .fb_iframe_widget{
228
width: 100%;
custom-facebook-feed-admin.php CHANGED
@@ -324,8 +324,8 @@ function cff_settings_page() {
324
<input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).'); ?>" />
325
<hr />
326
<h3><?php _e('Customizing your Feed'); ?></h3>
327
- <p><?php _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings directly in the shortcode like so:"); ?></p>
328
- <p>[custom-facebook-feed <b><span style='color: green;'>id=some-other-page-id num=3 height=500px</span></b>]</p>
329
<p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('See a full list of shortcode options'); ?></a></p>
330
331
<br />
@@ -491,6 +491,7 @@ function cff_style_page() {
491
'cff_custom_js' => '',
492
'cff_title_link' => false,
493
'cff_post_tags' => true,
494
'cff_event_title_link' => false,
495
'cff_video_action' => 'post',
496
'cff_sep_color' => '',
@@ -682,6 +683,7 @@ function cff_style_page() {
682
$cff_custom_js = $options[ 'cff_custom_js' ];
683
$cff_title_link = $options[ 'cff_title_link' ];
684
$cff_post_tags = $options[ 'cff_post_tags' ];
685
$cff_event_title_link = $options[ 'cff_event_title_link' ];
686
$cff_video_action = $options[ 'cff_video_action' ];
687
$cff_sep_color = $options[ 'cff_sep_color' ];
@@ -788,6 +790,8 @@ function cff_style_page() {
788
789
(isset($_POST[ 'cff_title_link' ]) ) ? $cff_title_link = $_POST[ 'cff_title_link' ] : $cff_title_link = '';
790
(isset($_POST[ 'cff_post_tags' ]) ) ? $cff_post_tags = $_POST[ 'cff_post_tags' ] : $cff_post_tags = '';
791
$cff_body_size = $_POST[ 'cff_body_size' ];
792
if (isset($_POST[ 'cff_body_weight' ]) ) $cff_body_weight = $_POST[ 'cff_body_weight' ];
793
if (isset($_POST[ 'cff_body_color' ]) ) $cff_body_color = $_POST[ 'cff_body_color' ];
@@ -879,6 +883,7 @@ function cff_style_page() {
879
$options[ 'cff_posttext_link_color' ] = $cff_posttext_link_color;
880
$options[ 'cff_title_link' ] = $cff_title_link;
881
$options[ 'cff_post_tags' ] = $cff_post_tags;
882
$options[ 'cff_body_size' ] = $cff_body_size;
883
$options[ 'cff_body_weight' ] = $cff_body_weight;
884
$options[ 'cff_body_color' ] = $cff_body_color;
@@ -1557,6 +1562,13 @@ function cff_style_page() {
1557
</td>
1558
</tr>
1559
1560
</tbody>
1561
</table>
1562
</div>
324
<input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).'); ?>" />
325
<hr />
326
<h3><?php _e('Customizing your Feed'); ?></h3>
327
+ <p><?php _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings and customizations by using options directly in the shortcode, like so:"); ?></p>
328
+ <p>[custom-facebook-feed id=some-other-page-id num=3 height=500px]</p>
329
<p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('See a full list of shortcode options'); ?></a></p>
330
331
<br />
491
'cff_custom_js' => '',
492
'cff_title_link' => false,
493
'cff_post_tags' => true,
494
+ 'cff_link_hashtags' => true,
495
'cff_event_title_link' => false,
496
'cff_video_action' => 'post',
497
'cff_sep_color' => '',
683
$cff_custom_js = $options[ 'cff_custom_js' ];
684
$cff_title_link = $options[ 'cff_title_link' ];
685
$cff_post_tags = $options[ 'cff_post_tags' ];
686
+ $cff_link_hashtags = $options[ 'cff_link_hashtags' ];
687
$cff_event_title_link = $options[ 'cff_event_title_link' ];
688
$cff_video_action = $options[ 'cff_video_action' ];
689
$cff_sep_color = $options[ 'cff_sep_color' ];
790
791
(isset($_POST[ 'cff_title_link' ]) ) ? $cff_title_link = $_POST[ 'cff_title_link' ] : $cff_title_link = '';
792
(isset($_POST[ 'cff_post_tags' ]) ) ? $cff_post_tags = $_POST[ 'cff_post_tags' ] : $cff_post_tags = '';
793
+ (isset($_POST[ 'cff_link_hashtags' ]) ) ? $cff_link_hashtags = $_POST[ 'cff_link_hashtags' ] : $cff_link_hashtags = '';
794
+
795
$cff_body_size = $_POST[ 'cff_body_size' ];
796
if (isset($_POST[ 'cff_body_weight' ]) ) $cff_body_weight = $_POST[ 'cff_body_weight' ];
797
if (isset($_POST[ 'cff_body_color' ]) ) $cff_body_color = $_POST[ 'cff_body_color' ];
883
$options[ 'cff_posttext_link_color' ] = $cff_posttext_link_color;
884
$options[ 'cff_title_link' ] = $cff_title_link;
885
$options[ 'cff_post_tags' ] = $cff_post_tags;
886
+ $options[ 'cff_link_hashtags' ] = $cff_link_hashtags;
887
$options[ 'cff_body_size' ] = $cff_body_size;
888
$options[ 'cff_body_weight' ] = $cff_body_weight;
889
$options[ 'cff_body_color' ] = $cff_body_color;
1562
</td>
1563
</tr>
1564
1565
+ <tr>
1566
+ <th><label for="cff_link_hashtags" class="bump-left"><?php _e('Link Hashtags?'); ?></label></th>
1567
+ <td>
1568
+ <input type="checkbox" name="cff_link_hashtags" id="cff_link_hashtags" <?php if($cff_link_hashtags == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
1569
+ </td>
1570
+ </tr>
1571
+
1572
</tbody>
1573
</table>
1574
</div>
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.8.1
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
@@ -76,6 +76,8 @@ function display_cff($atts) {
76
'textlinkcolor' => isset($options[ 'cff_posttext_link_color' ]) ? $options[ 'cff_posttext_link_color' ] : '',
77
'textlink' => isset($options[ 'cff_title_link' ]) ? $options[ 'cff_title_link' ] : '',
78
'posttags' => isset($options[ 'cff_post_tags' ]) ? $options[ 'cff_post_tags' ] : '',
79
//Description
80
'descsize' => isset($options[ 'cff_body_size' ]) ? $options[ 'cff_body_size' ] : '',
81
'descweight' => isset($options[ 'cff_body_weight' ]) ? $options[ 'cff_body_weight' ] : '',
@@ -413,7 +415,10 @@ function display_cff($atts) {
413
//Compile Like box styles
414
$cff_likebox_styles = 'style="width: ' . $cff_likebox_width . ';';
415
if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= ' background-color: #' . str_replace('#', '', $cff_likebox_bg_color) . ';';
416
- if ( empty($cff_likebox_bg_color) && $cff_like_box_faces == 'false' ) $cff_likebox_styles .= ' margin-left: -10px;';
417
$cff_likebox_styles .= '"';
418
419
//Get feed header settings
@@ -1132,7 +1137,12 @@ function display_cff($atts) {
1132
$ajax_theme = $atts['ajax'];
1133
( $ajax_theme == 'on' || $ajax_theme == 'true' || $ajax_theme == true ) ? $ajax_theme = true : $ajax_theme = false;
1134
if( $atts[ 'ajax' ] == 'false' ) $ajax_theme = false;
1135
- if ($ajax_theme) $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
1136
1137
$cff_content .= '</div>';
1138
@@ -1607,20 +1617,23 @@ add_action( 'wp_footer', 'cff_js' );
1607
function cff_js() {
1608
$options = get_option('cff_style_settings');
1609
$cff_custom_js = isset($options[ 'cff_custom_js' ]) ? $options[ 'cff_custom_js' ] : '';
1610
-
1611
- if( !empty($cff_custom_js) ) echo "\r\n";
1612
- if( !empty($cff_custom_js) ) echo '<!-- Custom Facebook Feed JS -->';
1613
- if( !empty($cff_custom_js) ) echo "\r\n";
1614
- if( !empty($cff_custom_js) ) echo '<script type="text/javascript">';
1615
- if( !empty($cff_custom_js) ) echo "\r\n";
1616
if( !empty($cff_custom_js) ) echo "jQuery( document ).ready(function($) {";
1617
if( !empty($cff_custom_js) ) echo "\r\n";
1618
if( !empty($cff_custom_js) ) echo stripslashes($cff_custom_js);
1619
if( !empty($cff_custom_js) ) echo "\r\n";
1620
if( !empty($cff_custom_js) ) echo "});";
1621
if( !empty($cff_custom_js) ) echo "\r\n";
1622
- if( !empty($cff_custom_js) ) echo '</script>';
1623
- if( !empty($cff_custom_js) ) echo "\r\n";
1624
}
1625
1626
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
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
76
'textlinkcolor' => isset($options[ 'cff_posttext_link_color' ]) ? $options[ 'cff_posttext_link_color' ] : '',
77
'textlink' => isset($options[ 'cff_title_link' ]) ? $options[ 'cff_title_link' ] : '',
78
'posttags' => isset($options[ 'cff_post_tags' ]) ? $options[ 'cff_post_tags' ] : '',
79
+ 'linkhashtags' => isset($options[ 'cff_link_hashtags' ]) ? $options[ 'cff_link_hashtags' ] : '',
80
+
81
//Description
82
'descsize' => isset($options[ 'cff_body_size' ]) ? $options[ 'cff_body_size' ] : '',
83
'descweight' => isset($options[ 'cff_body_weight' ]) ? $options[ 'cff_body_weight' ] : '',
415
//Compile Like box styles
416
$cff_likebox_styles = 'style="width: ' . $cff_likebox_width . ';';
417
if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= ' background-color: #' . str_replace('#', '', $cff_likebox_bg_color) . ';';
418
+
419
+ //Set the left margin on the like box based on how it's being displayed
420
+ if ( (!empty($cff_likebox_bg_color) && $cff_likebox_bg_color != '#') || ($cff_like_box_faces == 'true' || $cff_like_box_faces == 'on') ) $cff_likebox_styles .= ' margin-left: 0px;';
421
+
422
$cff_likebox_styles .= '"';
423
424
//Get feed header settings
1137
$ajax_theme = $atts['ajax'];
1138
( $ajax_theme == 'on' || $ajax_theme == 'true' || $ajax_theme == true ) ? $ajax_theme = true : $ajax_theme = false;
1139
if( $atts[ 'ajax' ] == 'false' ) $ajax_theme = false;
1140
+ if ($ajax_theme) {
1141
+ $cff_link_hashtags = $atts['linkhashtags'];
1142
+ ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1143
+ $cff_content .= '<script type="text/javascript">var cfflinkhashtags = "' . $cff_link_hashtags . '";</script>';
1144
+ $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
1145
+ }
1146
1147
$cff_content .= '</div>';
1148
1617
function cff_js() {
1618
$options = get_option('cff_style_settings');
1619
$cff_custom_js = isset($options[ 'cff_custom_js' ]) ? $options[ 'cff_custom_js' ] : '';
1620
+ $cff_link_hashtags = $options[ 'cff_link_hashtags' ];
1621
+ ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1622
+
1623
+ echo '<!-- Custom Facebook Feed JS -->';
1624
+ echo "\r\n";
1625
+ echo '<script type="text/javascript">';
1626
+ echo "\r\n";
1627
+ echo 'var cfflinkhashtags = "' . $cff_link_hashtags . '";';
1628
+ echo "\r\n";
1629
if( !empty($cff_custom_js) ) echo "jQuery( document ).ready(function($) {";
1630
if( !empty($cff_custom_js) ) echo "\r\n";
1631
if( !empty($cff_custom_js) ) echo stripslashes($cff_custom_js);
1632
if( !empty($cff_custom_js) ) echo "\r\n";
1633
if( !empty($cff_custom_js) ) echo "});";
1634
if( !empty($cff_custom_js) ) echo "\r\n";
1635
+ echo '</script>';
1636
+ echo "\r\n";
1637
}
1638
1639
js/cff-scripts.js CHANGED
@@ -55,6 +55,19 @@ jQuery(document).ready(function() {
55
if( $sharedLink.text() == '' ){
56
$sharedLink.remove();
57
}
58
59
});
60
});
55
if( $sharedLink.text() == '' ){
56
$sharedLink.remove();
57
}
58
+
59
+ //Link hashtags
60
+ if(cfflinkhashtags == 'true'){
61
+ var str = $self.find('.cff-text').html(),
62
+ regex = /\B#\w*[a-zA-Z]+\w*/gi,
63
+ linkcolor = $self.find('.cff-text').attr('rel');
64
+
65
+ function replacer(hash){
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
});
73
});