Fix HTML for staff in event performance table

This commit is contained in:
Nabil Kadimi
2019-04-27 00:17:36 +01:00
parent 81b4f0143b
commit 8a23c7c792
2 changed files with 11 additions and 8 deletions

View File

@@ -68,8 +68,8 @@ $i = 0;
foreach ( $subs as $sub_id => $sub ):
if ( ! $sub_id )
continue;
$index = sp_array_value( $sub, 'sub', 0 );
$lineup_sub_relation[ $index ] = $sub_id;
$i = sp_array_value( $sub, 'sub', 0 );
$lineup_sub_relation[ $i ] = $sub_id;
endforeach;
$data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );
@@ -274,7 +274,11 @@ $i = 0;
</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
<?php endif; ?>
</table>
<?php
if ( $show_staff ) {
echo sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
}
?>
</div>
<?php do_action( 'sportspress_after_event_performance_table', $data, $lineups, $subs, $class ); ?>
</div>

View File

@@ -236,6 +236,7 @@ if ( is_array( $teams ) ):
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null,
'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,
'show_staff' => $show_staff,
) );
}
@@ -256,9 +257,12 @@ if ( is_array( $teams ) ):
}
sp_get_template( 'event-performance-table.php', array(
'id' => $id,
'index' => $index,
'scrollable' => $scrollable,
'sortable' => $sortable,
'show_players' => $show_team_players,
'show_staff' => $show_staff,
'show_numbers' => $show_numbers,
'show_minutes' => $show_minutes,
'show_total' => $show_total,
@@ -272,14 +276,9 @@ if ( is_array( $teams ) ):
'link_posts' => $link_posts,
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null,
) );
}
}
if ( $show_staff ):
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
endif;
}
?>
<?php