From b60509a1c0b8ea8b313698e17ec9e8217313aa9a Mon Sep 17 00:00:00 2001
From: Cameron Jones
Date: Sat, 28 May 2016 16:32:35 +1000
Subject: [PATCH 1/5] Adding new interface for page tabs to the widget form
---
facebook-page-feed-graph-api.php | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/facebook-page-feed-graph-api.php b/facebook-page-feed-graph-api.php
index f0ff543..6edb125 100644
--- a/facebook-page-feed-graph-api.php
+++ b/facebook-page-feed-graph-api.php
@@ -29,6 +29,7 @@ public function __construct() {
define( 'CJW_FBPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CJW_FBPP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'CJW_FBPP_PLUGIN_VER', '1.5.3' );
+ define( 'CJW_FBPP_TABS', array( 'timeline', 'events', 'messages' ) );
//Add all the hooks and actions
add_shortcode( 'facebook-page-plugin', array( $this, 'facebook_page_plugin' ) );
@@ -408,12 +409,21 @@ public function form( $instance ) {
echo '';
echo ' ';
echo '
';
- echo '';
- echo '';
- echo ' ';
- echo '
';
+ echo '';
+ _e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
+ if( !empty( CJW_FBPP_TABS ) ) {
+ // First we should convert the string to an array as that's how it will be stored moving forward.
+ $oldtabs = esc_attr( $tabs );
+ $newtabs = explode( ',', $tabs );
+ $tabs = $newtabs;
+ foreach( CJW_FBPP_TABS as $tab ) {
+ echo '
';
+ }
+ }
+ echo '
';
echo '';
echo '';
echo ' ';
echo '
';
- echo '';
+ echo '
';
_e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
if( !empty( CJW_FBPP_TABS ) ) {
// First we should convert the string to an array as that's how it will be stored moving forward.
- $oldtabs = esc_attr( $tabs );
- $newtabs = explode( ',', $tabs );
- $tabs = $newtabs;
+ if( !is_array( $tabs ) ) {
+ $oldtabs = esc_attr( $tabs );
+ $newtabs = explode( ',', $tabs );
+ $tabs = $newtabs;
+ }
foreach( CJW_FBPP_TABS as $tab ) {
- echo '