Display player number in title and flag next to country name

This commit is contained in:
Brian Miyaji
2014-03-08 03:16:56 +11:00
parent 0d813cd986
commit 68ad967262
203 changed files with 16 additions and 6 deletions

View File

@@ -7,18 +7,16 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
global $sportspress_countries;
$number = get_post_meta( $id, 'sp_number', true );
$nationality = get_post_meta( $id, 'sp_nationality', true );
$current_team = get_post_meta( $id, 'sp_current_team', true );
$past_teams = get_post_meta( $id, 'sp_past_team', false );
$metrics = sportspress_get_player_metrics_data( $id );
$common = array();
if ( $number != null )
$common[ __( 'Number', 'sportspress' ) ] = $number;
if ( $nationality )
$common[ __( 'Nationality', 'sportspress' ) ] = sportspress_array_value( $sportspress_countries, $nationality, '—' );
if ( $nationality ):
$country_name = sportspress_array_value( $sportspress_countries, $nationality, null );
$common[ __( 'Nationality', 'sportspress' ) ] = $country_name ? '<img src="' . SPORTSPRESS_PLUGIN_URL . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' . $country_name : '&mdash;';
endif;
$data = array_merge( $common, $metrics );