Skip to content

Commit

Permalink
Fixing output of shortcode and widget rendering for tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronjonesweb committed May 28, 2016
1 parent 0181e3e commit 1bb74c8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions facebook-page-feed-graph-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,7 @@ function facebook_page_plugin( $filter ) {
$return .= ' data-show-facepile="' . $a['facepile'] . '"';
}
if(isset($a['tabs']) && !empty($a['tabs'])){
if( is_array( $a['tabs'] ) ) {
$return .= ' data-tabs="';
for( $i = 0; $i < count( $a['tabs'] ); $i++ ) {
$return .= $a['tabs'][$i];
$return .= ( $i = count( $a['tabs'] ) - 1 ? ',' : '' );
}
$return .= '"';
} else {
$return .= ' data-tabs="' . $a['tabs'] . '"';
}
$return .= ' data-tabs="' . $a['tabs'] . '"';
} else if(isset($a['posts']) && !empty($a['posts'])){
if($a['posts'] == 'true'){
$return .= ' data-tabs="timeline"';
Expand Down Expand Up @@ -288,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 . '"';
Expand Down

0 comments on commit 1bb74c8

Please sign in to comment.