$team_id ): if ( ! $team_id ) continue; // Get results for players in the team $players = sportspress_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $key ); $data = sportspress_array_combine( $players, sportspress_array_value( $stats, $team_id, array() ) ); $output .= '
| # | '; $output .= '' . __( 'Player', 'sportspress' ) . ' | '; foreach( $statistic_labels as $key => $label ): $output .= '' . $label . ' | '; endforeach; $output .= '
|---|---|---|
| ' . $number . ' | '; // Name as link $permalink = get_post_permalink( $player_id ); $name = get_the_title( $player_id ); $output .= '' . '' . $name . ' | '; foreach( $statistic_labels as $key => $label ): if ( $key == 'name' ) continue; if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): $value = $row[ $key ]; else: $value = 0; endif; $output .= '' . $value . ' | '; endforeach; $output .= '
| '; $output .= ' | ' . __( 'Total', 'sportspress' ) . ' | '; $row = $data[0]; foreach( $statistic_labels as $key => $label ): if ( $key == 'name' ): continue; endif; if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): $value = $row[ $key ]; else: $value = 0; endif; $output .= '' . $value . ' | '; endforeach; $output .= '