get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $countries = SP()->countries->countries; $player = new SP_Player( $id ); $nationality = $player->nationality; $current_team = $player->current_team; $past_teams = $player->past_teams(); $metrics_before = $player->metrics( true ); $metrics_after = $player->metrics( false ); $common = array(); if ( $nationality ): $country_name = sp_array_value( $countries, $nationality, null ); $common[ SP()->text->string('Nationality') ] = $country_name ? ( $show_nationality_flags ? '' . $nationality . ' ' : '' ) . $country_name : '—'; endif; $data = array_merge( $metrics_before, $common, $metrics_after ); if ( $current_team ) $data[ SP()->text->string('Current Team') ] = '' . get_the_title( $current_team ) . ''; if ( $past_teams ): $teams = array(); foreach ( $past_teams as $team ): $teams[] = '' . get_the_title( $team ) . ''; endforeach; $data[ SP()->text->string('Past Teams') ] = implode( ', ', $teams ); endif; $output = '
' . '
'; foreach( $data as $label => $value ): $output .= '
' . $label . '
' . $value . '
'; endforeach; $output .= '
'; echo apply_filters( 'sportspress_player_details', $output );