Add option to make tables sortable and responsive

This commit is contained in:
Brian Miyaji
2014-03-22 14:55:34 +11:00
parent 1b6d483b96
commit ce292db5cd
6 changed files with 91 additions and 25 deletions

View File

@@ -14,12 +14,14 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
'order' => 'ASC',
'show_all_players_link' => false,
'link_posts' => sportspress_array_value( $sportspress_options, 'player_list_link_posts', true ),
'sortable' => sportspress_array_value( $sportspress_options, 'player_list_sortable', true ),
'responsive' => sportspress_array_value( $sportspress_options, 'player_list_responsive', true ),
);
$r = wp_parse_args( $args, $defaults );
$output = '<div class="sp-table-wrapper">' .
'<table class="sp-player-list sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
'<table class="sp-player-list sp-data-table' . ( $r['responsive'] ? ' sp-responsive-table' : '' ) . ( $r['sortable'] ? ' sp-sortable-table' : '' ) . '">' . '<thead>' . '<tr>';
$data = sportspress_get_player_list_data( $id );