Add views counter and style tweaks
This commit is contained in:
@@ -9,16 +9,27 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
|
||||
|
||||
$defaults = array(
|
||||
'number_label' => __( 'Pos', 'sportspress' ),
|
||||
'thumbnails' => 1,
|
||||
'thumbnails' => 0,
|
||||
'thumbnail_size' => 'thumbnail'
|
||||
);
|
||||
|
||||
$r = wp_parse_args( $args, $defaults );
|
||||
|
||||
$data = sportspress_get_league_table_data( $id );
|
||||
$leagues = get_the_terms( $id, 'sp_league' );
|
||||
$seasons = get_the_terms( $id, 'sp_season' );
|
||||
|
||||
$terms = array();
|
||||
if ( isset( $leagues[0] ) )
|
||||
$terms[] = $leagues[0]->name;
|
||||
if ( isset( $seasons[0] ) )
|
||||
$terms[] = $seasons[0]->name;
|
||||
|
||||
$title = sizeof( $terms ) ? implode( ' — ', $terms ) : get_the_title( $id );
|
||||
|
||||
$output = '<table class="sp-league-table sp-data-table">' .
|
||||
'<caption>' . get_the_title( $id ) . '</caption>' . '<thead>' . '<tr>';
|
||||
'<caption>' . $title . '</caption>' . '<thead>' . '<tr>';
|
||||
|
||||
$data = sportspress_get_league_table_data( $id );
|
||||
|
||||
// The first row should be column labels
|
||||
$labels = $data[0];
|
||||
|
||||
@@ -13,11 +13,9 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
|
||||
$nationality = get_post_meta( $id, 'sp_nationality', true );
|
||||
$metrics = sportspress_get_player_metrics_data( $id );
|
||||
|
||||
$flag_image = '<img src="' . SPORTSPRESS_PLUGIN_URL . 'assets/images/flags/' . strtolower( $nationality ) . '.png" class="sp-flag">';
|
||||
|
||||
$common = array(
|
||||
__( 'Number', 'sportspress' ) => $number,
|
||||
__( 'Nationality', 'sportspress' ) => $flag_image . ' ' . sportspress_array_value( $sportspress_countries, $nationality, '—' ),
|
||||
__( 'Nationality', 'sportspress' ) => sportspress_array_value( $sportspress_countries, $nationality, '—' ),
|
||||
);
|
||||
|
||||
$data = array_merge( $common, $metrics );
|
||||
|
||||
Reference in New Issue
Block a user