Display player positions only if array

This commit is contained in:
Brian Miyaji
2014-08-26 02:16:38 +10:00
parent ce5997865d
commit a72c045a5b

View File

@@ -36,9 +36,9 @@ endif;
$position_names = array(); $position_names = array();
$positions = get_the_terms( $id, 'sp_position' ); $positions = get_the_terms( $id, 'sp_position' );
foreach ( $positions as $position ): if ( $positions ): foreach ( $positions as $position ):
$position_names[] = $position->name; $position_names[] = $position->name;
endforeach; endforeach; endif;
$common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names ); $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );