diff --git a/event.php b/event.php index 07c57b10..54b17ffb 100644 --- a/event.php +++ b/event.php @@ -76,6 +76,8 @@ function sp_event_stats_meta( $post ) { $limit = get_option( 'sp_event_team_count' ); $teams = array_pad( array_slice( (array)get_post_meta( $post->ID, 'sp_team', false ), 0, $limit ), $limit, 0 ); $stats = (array)get_post_meta( $post->ID, 'sp_stats', true ); + + // Teams foreach ( $teams as $key => $value ): $players = sp_array_between( (array)get_post_meta( $post->ID, 'sp_player', false ), 0, $key ); $data = sp_array_combine( $players, sp_array_value( $stats, $value, array() ) ); @@ -86,7 +88,7 @@ function sp_event_stats_meta( $post ) {
+ + term_id, array() ) ); ?> -
name; ?>
- term_id, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ) ); ?> -name; ?>
+ term_id, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ) ); ?> ID, 'sp_league' ); + $stats = (array)get_post_meta( $post->ID, 'sp_stats', true ); + + $keys = array( 0 ); + foreach ( $leagues as $key => $value ): + if ( is_object( $value ) && property_exists( $value, 'term_id' ) ) + $keys[] = $value->term_id; + endforeach; + + $data = sp_array_combine( $keys, sp_array_value( $stats, 0, array() ) ); + ?> + \ No newline at end of file