ID; endif; $defaults = array( 'number_label' => __( 'Pos', 'sportspress' ), 'thumbnails' => 1, 'thumbnail_size' => 'thumbnail' ); $r = wp_parse_args( $args, $defaults ); $data = sportspress_get_league_table_data( $id ); $output = '' . '' . '' . ''; // The first row should be column labels $labels = $data[0]; // Remove the first row to leave us with the actual data unset( $data[0] ); $output .= ''; foreach( $labels as $key => $label ): $output .= ''; endforeach; $output .= '' . '' . ''; $i = 0; foreach( $data as $team_id => $row ): $output .= ''; // Position as number $output .= ''; // Thumbnail and name as link $permalink = get_post_permalink( $team_id ); if ( $r['thumbnails'] ): $thumbnail = get_the_post_thumbnail( $team_id, $r['thumbnail_size'], array( 'class' => 'logo' ) ); else: $thumbnail = null; endif; $name = sportspress_array_value( $row, 'name', sportspress_array_value( $row, 'name', ' ' ) ); $output .= ''; foreach( $labels as $key => $value ): if ( $key == 'name' ) continue; $output .= ''; endforeach; $output .= ''; $i++; endforeach; $output .= '' . '
' . get_the_title( $id ) . '
' . $r['number_label'] . '' . $label . '
' . $i . '' . ( $thumbnail ? $thumbnail . ' ' : '' ) . '' . $name . '' . sportspress_array_value( $row, $key, '—' ) . '
'; return apply_filters( 'sportspress_league_table', $output ); } }