$label ): ?> $sub ): if ( ! $sub_id ) continue; $lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id; endforeach; $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode ); $i = 0; foreach ( $data as $player_id => $row ): if ( ! $player_id ) continue; $name = get_the_title( $player_id ); if ( ! $name ) continue; echo ''; if ( $show_numbers ) { $number = sp_array_value( $row, 'number', ' ' ); // Player number echo ''; } if ( $link_posts ): $permalink = get_post_permalink( $player_id ); $name = '' . $name . ''; endif; if ( array_key_exists( $player_id, $lineup_sub_relation ) ): $name .= ' ' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . ''; elseif ( isset( $row['sub'] ) && $row['sub'] ): $name .= ' ' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . ''; endif; echo ''; if ( $mode == 'icons' ) echo ''; elseif ( intval( $value ) && $mode == 'icons' ): $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value ); endif; echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; endforeach; if ( $mode == 'icons' ) echo ''; echo ''; $i++; endforeach; ?> <>  '; } echo ''; endif; $row = sp_array_value( $data, 0, array() ); if ( $mode == 'icons' ) echo ''; elseif ( intval( $value ) && $mode == 'icons' ): $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value ); endif; echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; endforeach; if ( $mode == 'icons' ) echo ''; ?> >
#  
' . $number . '' . $name . ''; foreach ( $labels as $key => $label ): if ( 'name' == $key ) continue; if ( isset( $position ) && 'position' == $key ) continue; $value = '—'; if ( $key == 'position' ): $positions = array(); if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): $position_ids = (array) $row[ $key ]; else: $position_ids = (array) sp_get_the_term_id( $player_id, 'sp_position' ); endif; foreach ( $position_ids as $position_id ) { $player_position = get_term_by( 'id', $position_id, 'sp_position' ); if ( $player_position ) $positions[] = $player_position->name; } if ( sizeof( $positions ) ): $value = implode( ', ', $positions ); endif; else: if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): $value = $row[ $key ]; else: $value = 0; endif; endif; if ( ! array_key_exists( $key, $totals ) ): $totals[ $key ] = 0; endif; $totals[ $key ] += $value; if ( $mode == 'values' ): echo '' . $value . '
' . __( 'Total', 'sportspress' ) . ''; foreach ( $labels as $key => $label ): if ( 'name' == $key ) continue; if ( isset( $position ) && 'position' == $key ) continue; if ( $key == 'position' ): $value = ' '; else: if ( $primary && $key !== $primary ): $value = ' '; elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): $value = $row[ $key ]; else: $value = apply_filters( 'sportspress_event_performance_table_total_value', sp_array_value( $totals, $key, 0 ), $data, $key ); endif; endif; if ( $mode == 'values' ): echo '' . $value . '