Merge pull request #302 from ThemeBoy/feature-default-nationality

Add Default Nationality option
This commit is contained in:
Brian Miyaji
2018-10-11 19:09:58 +11:00
committed by GitHub
2 changed files with 75 additions and 0 deletions

View File

@@ -24,6 +24,14 @@ class SP_Meta_Box_Player_Details {
$number = get_post_meta( $post->ID, 'sp_number', true );
$nationalities = get_post_meta( $post->ID, 'sp_nationality', false );
$default_nationality = get_option( 'sportspress_default_nationality' , false );
if ( empty( $nationalities ) && $default_nationality ) {
if ( $default_nationality != '' ) {
$nationalities[] = $default_nationality;
}
}
foreach ( $nationalities as $index => $nationality ):
if ( 2 == strlen( $nationality ) ):
$legacy = SP()->countries->legacy;