Responsive tables and individual content filters
This commit is contained in:
@@ -24,7 +24,8 @@ if ( !function_exists( 'sportspress_event_details' ) ) {
|
||||
|
||||
$output = '<h3>' . __( 'Details', 'sportspress' ) . '</h3>';
|
||||
|
||||
$output .= '<table class="sp-event-details sp-data-table"><tbody>';
|
||||
$output .= '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-event-details sp-data-table sp-responsive-table"><tbody>';
|
||||
|
||||
$i = 0;
|
||||
|
||||
@@ -39,7 +40,7 @@ if ( !function_exists( 'sportspress_event_details' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody></table>';
|
||||
$output .= '</tbody></table></div>';
|
||||
|
||||
return apply_filters( 'sportspress_event_details', $output );
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
|
||||
|
||||
$output .= '<h3>' . get_the_title( $team_id ) . '</h3>';
|
||||
|
||||
$output .= '<table class="sp-event-statistics sp-data-table">' . '<thead>' . '<tr>';
|
||||
$output .= '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-event-statistics sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||
|
||||
$output .= '<th class="data-number">#</th>';
|
||||
$output .= '<th class="data-number">' . __( 'Player', 'sportspress' ) . '</th>';
|
||||
@@ -93,7 +94,7 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
|
||||
|
||||
endif;
|
||||
|
||||
$output .= '</table>';
|
||||
$output .= '</table>' . '</div>';
|
||||
|
||||
endforeach;
|
||||
|
||||
|
||||
@@ -47,14 +47,15 @@ if ( !function_exists( 'sportspress_event_results' ) ) {
|
||||
|
||||
$output .= '<h3>' . __( 'Results', 'sportspress' ) . '</h3>';
|
||||
|
||||
$output .= '<table class="sp-event-results sp-data-table"><thead>';
|
||||
$output .= '<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
||||
$output .= '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
||||
'<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
||||
foreach( $result_labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
endforeach;
|
||||
$output .= '</tr>' . '</thead>' . '<tbody>';
|
||||
$output .= $table_rows;
|
||||
$output .= '</tbody></table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
|
||||
$title = sizeof( $terms ) ? implode( ' — ', $terms ) : get_the_title( $id );
|
||||
|
||||
$output = '<h4 class="sp-table-caption">' . $title . '</h4>' .
|
||||
'<table class="sp-league-table sp-data-table">' . '<thead>' . '<tr>';
|
||||
'<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-league-table sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||
|
||||
$data = sportspress_get_league_table_data( $id );
|
||||
|
||||
@@ -73,7 +74,7 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody>' . '</table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
return apply_filters( 'sportspress_league_table', $output );
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
|
||||
return false;
|
||||
|
||||
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
||||
'<table class="sp-player-statistics sp-data-table">' . '<thead>' . '<tr>';
|
||||
'<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-player-statistics sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
@@ -45,7 +46,7 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody>' . '</table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
return apply_filters( 'sportspress_player_league_statistics', $output );
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
||||
|
||||
$data = sportspress_get_player_list_data( $id );
|
||||
|
||||
$output = '<table class="sp-player-list sp-data-table">' . '<thead>' . '<tr>';
|
||||
$output = '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-player-list sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||
|
||||
// The first row should be column labels
|
||||
$labels = $data[0];
|
||||
@@ -49,7 +50,7 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody>' . '</table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
return apply_filters( 'sportspress_player_list', $output );
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
|
||||
|
||||
$data = array_merge( $common, $metrics );
|
||||
|
||||
$output = '<table class="sp-player-metrics sp-data-table">' . '<tbody>';
|
||||
$output = '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-player-metrics sp-data-table sp-responsive-table">' . '<tbody>';
|
||||
|
||||
$i = 0;
|
||||
|
||||
@@ -30,7 +31,7 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody>' . '</table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
return apply_filters( 'sportspress_player_metrics', $output );
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ if ( !function_exists( 'sportspress_team_columns' ) ) {
|
||||
unset( $data[0] );
|
||||
|
||||
$output .= '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
||||
'<table class="sp-team-columns sp-data-table">' . '<thead>' . '<tr>';
|
||||
'<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-team-columns sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
@@ -51,7 +52,7 @@ if ( !function_exists( 'sportspress_team_columns' ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
$output .= '</tbody>' . '</table>';
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
|
||||
endforeach;
|
||||
|
||||
Reference in New Issue
Block a user