Prevent error on team page when there are no competitions or seasons.
This commit is contained in:
@@ -421,12 +421,9 @@ class SP_Team extends SP_Custom_Post {
|
||||
*/
|
||||
public function tables( $admin = false ) {
|
||||
if ( ! $this->ID ) return null;
|
||||
|
||||
$leagues = get_the_terms( $this->ID, 'sp_league' );
|
||||
$league_ids = wp_list_pluck( $leagues, 'term_id' );
|
||||
|
||||
$seasons = get_the_terms( $this->ID, 'sp_season' );
|
||||
$season_ids = wp_list_pluck( $seasons, 'term_id' );
|
||||
|
||||
$league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );
|
||||
$season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'sp_table',
|
||||
|
||||
Reference in New Issue
Block a user