Add past team correctly when importing players

This commit is contained in:
Nabil Kadimi
2018-05-11 20:57:07 +01:00
committed by GitHub
parent 3db92801ae
commit 60cf658bbc

View File

@@ -123,9 +123,11 @@ if ( class_exists( 'WP_Importer' ) ) {
// Add team to player
add_post_meta( $id, 'sp_team', $team_id );
// Update current team if first in array
// Update current team if first in array, otherwise use as past team
if ( $i == 0 ):
update_post_meta( $id, 'sp_current_team', $team_id );
else :
add_post_meta( $id, 'sp_past_team', $team_id );
endif;
$i++;