Add ability to sort defensive players in box score

This commit is contained in:
Brian Miyaji
2016-02-17 03:14:15 +11:00
parent f7aaf4f16a
commit 73f9584b29
3 changed files with 33 additions and 9 deletions

View File

@@ -150,6 +150,16 @@ if ( is_array( $teams ) ):
foreach ( $section_order as $section_id => $section_label ) {
if ( sizeof( $data[ $section_id ] ) ) {
if ( 1 == $section_id ) {
$order = (array)get_post_meta( $id, 'sp_order', true );
if ( is_array( $order ) && sizeof( $order ) ) {
$player_order = sp_array_value( $order, $team_id, array() );
if ( is_array( $player_order ) ) {
$data[1] = sp_array_combine( $player_order, $data[1], true );
}
}
}
sp_get_template( 'event-performance-table.php', array(
'section' => $section_label,
'scrollable' => $scrollable,