/** * Single page match player row. * * @access public * @param array * @param string $key * @param string $value * @param int $count * @return mixed $output */ function wpcm_match_player_row($key, $value, $count = 0) { $number = get_post_meta($key, 'wpcm_number', true); $show_number = get_option('wpcm_player_profile_show_number'); $sport = get_option('wpcm_sport'); if ($show_number == 'yes' && $number == true) { $snumber = $number . '. '; } else { $snumber = ''; } if (get_option('wpcm_results_show_image') == 'yes') { if (has_post_thumbnail($key)) { $image = ' ' . get_the_post_thumbnail($key, 'player_thumbnail', array('class' => 'lineup-thumb')) . ' '; } else { $image = wpcm_placeholder_img('player_thumbnail'); } } else { $image = ''; } if (isset($value['mvp'])) { $mvp = '<span class="mvp" title="' . __('Man of Match', 'wp-club-manager') . '">★</span>'; } else { $mvp = ''; } $output = ''; $output .= '<tr>'; $output .= '<th class="name"><div>' . $snumber . '' . $image . '<a href="' . get_permalink($key) . '">' . get_the_title($key) . '</a>' . $mvp; if (array_key_exists('sub', $value) && $value['sub'] > 0) { $output .= '<span class="sub">← ' . get_the_title($value['sub']) . '</span>'; } $output .= '</div></th>'; foreach ($value as $key => $stat) { if ($stat == '0' || $stat == null) { $stat = '—'; } if ($key == 'checked' || $key == 'sub' || $key == 'greencards' || $key == 'yellowcards' || $key == 'blackcards' || $key == 'redcards' || $key == 'mvp') { $output .= ''; } else { if (get_option('wpcm_show_stats_' . $key) == 'yes') { $output .= '<td class="' . $key . '">' . $stat . '</td>'; } } } if (get_option('wpcm_show_stats_greencards') == 'yes' || get_option('wpcm_show_stats_yellowcards') == 'yes' || get_option('wpcm_show_stats_blackcards') == 'yes' || get_option('wpcm_show_stats_redcards') == 'yes') { //if( $sport == 'soccer' || $sport == 'rugby' || $sport == 'hockey_field' || $sport == 'footy' || $sport == 'floorball' || $sport == 'gaelic' || $sport == 'handball' ) { $output .= '<td class="notes">'; if (get_option('wpcm_show_stats_greencards') == 'yes' && isset($value['greencards'])) { $output .= '<span class="greencard" title="' . __('Green Card', 'wp-club-manager') . '">' . __('Green Card', 'wp-club-manager') . '</span>'; } if (get_option('wpcm_show_stats_yellowcards') == 'yes' && isset($value['yellowcards'])) { $output .= '<span class="yellowcard" title="' . __('Yellow Card', 'wp-club-manager') . '">' . __('Yellow Card', 'wp-club-manager') . '</span>'; } if (get_option('wpcm_show_stats_blackcards') == 'yes' && isset($value['blackcards'])) { $output .= '<span class="blackcard" title="' . __('Black Card', 'wp-club-manager') . '">' . __('Black Card', 'wp-club-manager') . '</span>'; } if (get_option('wpcm_show_stats_redcards') == 'yes' && isset($value['redcards'])) { $output .= '<span class="redcard" title="' . __('Red Card', 'wp-club-manager') . '">' . __('Red Card', 'wp-club-manager') . '</span>'; } $output .= '</td>'; //} } $output .= '</tr>'; return $output; }
</div> <div class="slick-class">'; $player_details = array(); foreach ($players as $player) { $player_details[$player->ID] = array(); $count++; if (array_intersect_key(array_flip($stats), $player_stats_labels)) { $player_stats = get_wpcm_player_stats_from_post($player->ID); } $number = get_post_meta($player->ID, 'wpcm_number', true); $name = $player->post_title; $positions = get_the_terms($player->ID, 'wpcm_position'); if (has_post_thumbnail($player->ID)) { $thumb = get_the_post_thumbnail($player->ID, 'player_thumbnail'); } else { $thumb = wpcm_placeholder_img('player_thumbnail'); } if (is_array($positions)) { $position = reset($positions); $position = $position->name; } else { $position = __('None', 'wp-club-manager'); } $dob = get_post_meta($player->ID, 'wpcm_dob', true); $height = get_post_meta($player->ID, 'wpcm_height', true); $weight = get_post_meta($player->ID, 'wpcm_weight', true); $natl = get_post_meta($player->ID, 'wpcm_natl', true); $hometown = get_post_meta($player->ID, 'wpcm_hometown', true); foreach ($stats as $stat) { $player_details[$player->ID][$stat] = ''; if (array_key_exists($stat, $player_stats_labels)) {
foreach ($stats as $stat) { $output .= '<th class="' . $stat . '">' . $stats_labels[$stat] . '</th>'; } $output .= '</tr> </thead> <tbody>'; $player_details = array(); foreach ($staff as $player) { $player_details[$player->ID] = array(); $count++; $name = $player->post_title; $jobs = get_the_terms($player->ID, 'wpcm_jobs'); if (has_post_thumbnail($player->ID)) { $thumb = get_the_post_thumbnail($player->ID, 'staff_thumbnail'); } else { $thumb = wpcm_placeholder_img('staff_thumbnail'); } if (is_array($jobs)) { $job = reset($jobs); $job = $job->name; } else { $job = __('None', 'wp-club-manager'); } $natl = get_post_meta($player->ID, 'wpcm_natl', true); $email = get_post_meta($player->ID, '_wpcm_staff_email', true); $phone = get_post_meta($player->ID, '_wpcm_staff_phone', true); foreach ($stats as $stat) { switch ($stat) { case 'thumb': $player_details[$player->ID][$stat] = ''; $player_details[$player->ID][$stat] .= '<a href="' . get_permalink($player->ID) . '">' . $thumb . '</a>';