Use 3-letter FIFA country codes with fallback to 2-letter codes
This commit is contained in:
@@ -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'] );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user