Use 3-letter FIFA country codes with fallback to 2-letter codes

This commit is contained in:
Brian Miyaji
2015-02-02 22:43:48 +11:00
parent 4b8bdd969e
commit ffa6274918
488 changed files with 214958 additions and 226 deletions

View File

@@ -29,8 +29,13 @@ $past_teams = $staff->past_teams();
$data = array();
if ( $nationality ):
if ( 2 == strlen( $nationality ) ):
$legacy = SP()->countries->legacy;
$nationality = strtolower( $nationality );
$nationality = sp_array_value( $legacy, $nationality, null );
endif;
$country_name = sp_array_value( $countries, $nationality, null );
$data[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '&mdash;';
$data[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '&mdash;';
endif;
if ( $current_team )