sportspress_array_value( $sportspress_options, 'player_show_nationality_flag', true ), ); $r = wp_parse_args( $args, $defaults ); $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 ( $nationality ): $country_name = sportspress_array_value( $sportspress_countries, $nationality, null ); $common[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $r['show_nationality_flag'] ? '' . $nationality . ' ' : '' ) . $country_name : '—'; endif; $data = array_merge( $common, $metrics ); if ( $current_team ) $data[ __( 'Current Team', 'sportspress' ) ] = '' . get_the_title( $current_team ) . ''; if ( $past_teams ): $teams = array(); foreach ( $past_teams as $team ): $teams[] = '' . get_the_title( $team ) . ''; endforeach; $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams ); endif; $output = '
' . '
'; foreach( $data as $label => $value ): $output .= '
' . $label . '
' . $value . '
'; endforeach; $output .= '
'; return apply_filters( 'sportspress_player_metrics', $output ); } }