Show league table caption by default

This commit is contained in:
Brian Miyaji
2014-05-10 22:45:41 +10:00
parent 9a5cc58072
commit a1462b46a3
3 changed files with 2 additions and 8 deletions

View File

@@ -19,9 +19,6 @@ class SP_Shortcode_League_Table {
if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
$atts['id'] = $atts[0];
if ( ! isset( $atts['show_caption'] ) )
$atts['show_caption'] = true;
sp_get_template( 'league-table.php', $atts );
}
}

View File

@@ -18,7 +18,7 @@ class SP_Widget_League_Table extends WP_Widget {
if ( $title )
echo $before_title . $title . $after_title;
echo '<div id="sp_league_table_wrap">';
sp_get_template( 'league-table.php', array( 'id' => $id, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo, 'show_caption' => true ) );
sp_get_template( 'league-table.php', array( 'id' => $id, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo ) );
echo '</div>';
echo $after_widget;
}

View File

@@ -15,7 +15,6 @@ $defaults = array(
'columns' => null,
'show_full_table_link' => false,
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
'show_caption' => false,
'link_posts' => get_option( 'sportspress_table_link_teams', 'no' ) == 'yes' ? true : false,
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
@@ -27,9 +26,7 @@ extract( $defaults, EXTR_SKIP );
$output = '<div class="sp-table-wrapper sp-scrollable-table-wrapper">';
if ( $show_caption ):
$output .= '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
endif;
$output .= '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
$output .= '<table class="sp-league-table sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';