get_the_ID(), 'number' => -1, 'performance' => null, 'grouping' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => false, 'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_list_rows', 10 ), ); extract( $defaults, EXTR_SKIP ); $list = new SP_Player_List( $id ); $data = $list->data(); // The first row should be column labels $labels = $data[0]; // Remove the first row to leave us with the actual data unset( $data[0] ); if ( ! $grouping || $grouping == 'default' ): $grouping = $list->grouping; endif; if ( $orderby == 'default' ): $orderby = $list->orderby; $order = $list->order; else: $list->priorities = array( array( 'key' => $orderby, 'order' => $order, ), ); uasort( $data, array( $list, 'sort' ) ); endif; if ( $grouping == 'position' ): $groups = get_terms( 'sp_position' ); else: $group = new stdClass(); $group->term_id = null; $group->name = null; $group->slug = null; $groups = array( $group ); endif; $output = ''; foreach ( $groups as $group ): if ( ! empty( $group->name ) ) $output .= '
| # | '; else: $output .= '' . SP()->text->string('Rank') . ' | '; endif; foreach( $labels as $key => $label ): if ( ! is_array( $performance ) || $key == 'name' || in_array( $key, $performance ) ) $output .= ''. $label . ' | '; endforeach; $output .= '|
|---|---|---|---|
| ' . ( $i + 1 ) . ' | '; else: $output .= '' . sp_array_value( $row, 'number', ' ' ) . ' | '; endif; if ( $link_posts ): $permalink = get_post_permalink( $player_id ); $name = '' . $name . ''; endif; $output .= '' . $name . ' | '; foreach( $labels as $key => $value ): if ( $key == 'name' ) continue; if ( ! is_array( $performance ) || in_array( $key, $performance ) ) $output .= '' . sp_array_value( $row, $key, '—' ) . ' | '; endforeach; $output .= '