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

@@ -336,7 +336,7 @@ class SP_Admin_Sample_Data {
// Update meta
update_post_meta( $id, 'sp_columns', $columns );
update_post_meta( $id, 'sp_number', $index + 1 );
update_post_meta( $id, 'sp_nationality', 'AU' );
update_post_meta( $id, 'sp_nationality', 'aus' );
update_post_meta( $id, 'sp_current_team', $current_team );
sp_update_post_meta_recursive( $id, 'sp_past_team', $past_teams );
sp_update_post_meta_recursive( $id, 'sp_team', $inserted_ids['sp_team'] );

View File

@@ -124,7 +124,7 @@ if ( class_exists( 'WP_Importer' ) ) {
endforeach;
// Update nationality
$nationality = trim( strtoupper( sp_array_value( $meta, 'sp_nationality' ) ) );
$nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) );
if ( $nationality == '*' ) $nationality = '';
update_post_meta( $id, 'sp_nationality', $nationality );

View File

@@ -120,7 +120,7 @@ if ( class_exists( 'WP_Importer' ) ) {
endforeach;
// Update nationality
$nationality = trim( strtoupper( sp_array_value( $meta, 'sp_nationality' ) ) );
$nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) );
if ( $nationality == '*' ) $nationality = '';
update_post_meta( $id, 'sp_nationality', $nationality );

View File

@@ -24,6 +24,11 @@ class SP_Meta_Box_Player_Details {
$number = get_post_meta( $post->ID, 'sp_number', true );
$nationality = get_post_meta( $post->ID, 'sp_nationality', true );
if ( 2 == strlen( $nationality ) ):
$legacy = SP()->countries->legacy;
$nationality = strtolower( $nationality );
$nationality = sp_array_value( $legacy, $nationality, null );
endif;
$leagues = get_the_terms( $post->ID, 'sp_league' );
$league_ids = array();

View File

@@ -23,6 +23,11 @@ class SP_Meta_Box_Staff_Details {
$continents = SP()->countries->continents;
$nationality = get_post_meta( $post->ID, 'sp_nationality', true );
if ( 2 == strlen( $nationality ) ):
$legacy = SP()->countries->legacy;
$nationality = strtolower( $nationality );
$nationality = sp_array_value( $legacy, $nationality, null );
endif;
$leagues = get_the_terms( $post->ID, 'sp_league' );
$league_ids = array();