Example #1
0
         $output .= '<td class="data-rank">' . ($i + 1) . '</td>';
     } else {
         $output .= '<td class="data-number">' . sp_array_value($row, 'number', '&nbsp;') . '</td>';
     }
 }
 $name_class = '';
 if ($show_player_photo) {
     if (has_post_thumbnail($player_id)) {
         $logo = get_the_post_thumbnail($player_id, 'sportspress-fit-icon');
         $name = '<span class="player-photo">' . $logo . '</span>' . $name;
         $name_class .= ' has-photo';
     }
 }
 if ($show_player_flag) {
     $player = new SP_Player($player_id);
     $nationalities = $player->nationalities();
     if (!empty($nationalities)) {
         foreach ($nationalities as $nationality) {
             $name = '<span class="player-flag"><img src="' . plugin_dir_url(SP_PLUGIN_FILE) . 'assets/images/flags/' . strtolower($nationality) . '.png" alt="' . $nationality . '"></span>' . $name;
         }
         $name_class .= ' has-photo';
     }
 }
 if ($link_posts) {
     $permalink = get_post_permalink($player_id);
     $name = '<a href="' . $permalink . '">' . $name . '</a>';
 }
 $output .= '<td class="data-name' . $name_class . '">' . $name . '</td>';
 if (array_key_exists('team', $labels)) {
     $team = sp_array_value($row, 'team', get_post_meta($id, 'sp_team', true));
     $team_name = sp_get_team_name($team, $abbreviate_teams);