Prepend teams to linear timeline array
This commit is contained in:
@@ -283,6 +283,14 @@ class SP_Event extends SP_Custom_Post{
|
||||
$side = 'away';
|
||||
}
|
||||
|
||||
$stats[] = array(
|
||||
'time' => -1,
|
||||
'id' => $team,
|
||||
'team' => $team,
|
||||
'side' => $side,
|
||||
'key' => 'team',
|
||||
);
|
||||
|
||||
if ( ! is_array( $players ) ) continue;
|
||||
|
||||
foreach ( $players as $player => $keys ) {
|
||||
@@ -356,7 +364,7 @@ class SP_Event extends SP_Custom_Post{
|
||||
|
||||
$icon = '';
|
||||
if ( has_post_thumbnail( $post->ID ) ) {
|
||||
$icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini' );
|
||||
$icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $post->ID ) ) );
|
||||
}
|
||||
$performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );
|
||||
}
|
||||
@@ -367,7 +375,12 @@ class SP_Event extends SP_Custom_Post{
|
||||
$stats[ $index ]['name'] = sp_array_value( $player_names, $details['id'] );
|
||||
$stats[ $index ]['number'] = sp_array_value( $player_numbers, $details['id'] );
|
||||
|
||||
if ( 'sub' === $details['key'] ) {
|
||||
if ( 'team' === $details['key'] ) {
|
||||
$name = sp_get_team_name( $details['team'] );
|
||||
$stats[ $index ]['name'] = $name;
|
||||
$stats[ $index ]['label'] = $name;
|
||||
$stats[ $index ]['icon'] = sp_get_logo( $details['team'] );
|
||||
} elseif ( 'sub' === $details['key'] ) {
|
||||
$sub_name = sp_array_value( $player_names, $details['sub'], __( 'Substitute', 'sportspress' ) );
|
||||
$sub_number = sp_array_value( $player_numbers, $details['sub'] );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user