diff --git a/facebook-page-feed-graph-api.php b/facebook-page-feed-graph-api.php
index f0ff543..811ec15 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' ) );
@@ -278,7 +279,16 @@ public function widget( $args, $instance ) {
$shortcode .= ' facepile="' . $facepile . '"';
}
if( isset( $tabs ) && !empty( $tabs ) ){
- $shortcode .= ' tabs="' . $tabs . '"';
+ if( is_array( $tabs ) ) {
+ $shortcode .= ' tabs="';
+ for( $i = 0; $i < count( $tabs ); $i++ ) {
+ $shortcode .= $tabs[$i];
+ $shortcode .= ( $i != count( $tabs ) - 1 ? ',' : '' );
+ }
+ $shortcode .= '"';
+ } else {
+ $shortcode .= ' tabs="' . $tabs . '"';
+ }
}
if( isset( $language ) && !empty( $language ) ){
$shortcode .= ' language="' . $language . '"';
@@ -408,12 +418,23 @@ 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.
+ if( !is_array( $tabs ) ) {
+ $oldtabs = esc_attr( $tabs );
+ $newtabs = explode( ',', $tabs );
+ $tabs = $newtabs;
+ }
+ foreach( CJW_FBPP_TABS as $tab ) {
+ echo '
';
+ }
+ }
+ echo '
';
echo '';
echo '