Avoid filtering if League AND Season arrays are empty

It makes more sense. That way you can filter a Player List by League and Team, or by Season and Team. Otherwise you have false positives!
This commit is contained in:
savvasha
2020-07-25 20:14:21 +03:00
committed by GitHub
parent b7222ee485
commit 8254c1686e

View File

@@ -78,7 +78,7 @@ class SportsPress_Player_Assignments {
if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) $season_ids = sp_array_value( $param, 'terms', array() );
}
if ( empty( $league_ids ) || empty( $season_ids ) ) return $args;
if ( empty( $league_ids ) && empty( $season_ids ) ) return $args;
$args['meta_query'][] = array(
'key' => 'sp_assignments',