diff --git a/includes/class-sp-event.php b/includes/class-sp-event.php index 7a821ad9..0090610e 100644 --- a/includes/class-sp-event.php +++ b/includes/class-sp-event.php @@ -55,10 +55,16 @@ class SP_Event extends SP_Custom_Post{ $lineup = array_filter( $data, array( $this, 'lineup_filter' ) ); $subs = array_filter( $data, array( $this, 'sub_filter' ) ); - foreach ( $subs as $sub_id => $sub ): - if ( ! $sub_id ) + foreach ( $subs as $player_id => $player ): + if ( ! $player_id ) continue; - $lineup[ sp_array_value( $sub, 'sub', 0 ) ]['sub'] = $sub_id; + + $sub = sp_array_value( $player, 'sub', 0 ); + + if ( ! $sub ) + continue; + + $lineup[ $sub ]['sub'] = $player_id; endforeach; $output[ $team_id ] = array( diff --git a/readme.txt b/readme.txt index c2afed04..2d2156e8 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: sport, sports, press, club, sport statistics, sports management, soccer, f Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=support@themeboy.com&item_name=Donation+for+SportsPress Requires at least: 3.8 Tested up to: 3.9 -Stable tag: 0.8.5 +Stable tag: 0.8.6 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html