From 286e1c50d451097115bffcc6158287f510de6f89 Mon Sep 17 00:00:00 2001
From: Brian Miyaji
-
'sp_position', - 'name' => 'tax_input[sp_position][]', - 'selected' => $position_ids, - 'values' => 'term_id', - 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Positions', 'sportspress' ) ), - 'class' => 'widefat', - 'property' => 'multiple', - 'chosen' => true, - ); - sp_dropdown_taxonomies( $args ); - ?>
+ ++
'sp_position', + 'name' => 'tax_input[sp_position][]', + 'selected' => $position_ids, + 'values' => 'term_id', + 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Positions', 'sportspress' ) ), + 'class' => 'widefat', + 'property' => 'multiple', + 'chosen' => true, + ); + sp_dropdown_taxonomies( $args ); + ?>
+@@ -123,6 +131,7 @@ class SP_Meta_Box_Player_Details { ?> +
+ +
+ ID, 'sp_league' ); - $league_ids = array(); - if ( $leagues ): - foreach ( $leagues as $league ): - $league_ids[] = $league->term_id; - endforeach; + + if ( taxonomy_exists( 'sp_league' ) ): + $leagues = get_the_terms( $post->ID, 'sp_league' ); + $league_ids = array(); + if ( $leagues ): + foreach ( $leagues as $league ): + $league_ids[] = $league->term_id; + endforeach; + endif; endif; - $seasons = get_the_terms( $post->ID, 'sp_season' ); - $season_ids = array(); - if ( $seasons ): - foreach ( $seasons as $season ): - $season_ids[] = $season->term_id; - endforeach; + if ( taxonomy_exists( 'sp_season' ) ): + $seasons = get_the_terms( $post->ID, 'sp_season' ); + $season_ids = array(); + if ( $seasons ): + foreach ( $seasons as $season ): + $season_ids[] = $season->term_id; + endforeach; + endif; endif; - $venues = get_the_terms( $post->ID, 'sp_venue' ); - $venue_ids = array(); - if ( $venues ): - foreach ( $venues as $venue ): - $venue_ids[] = $venue->term_id; - endforeach; + if ( taxonomy_exists( 'sp_venue' ) ): + $venues = get_the_terms( $post->ID, 'sp_venue' ); + $venue_ids = array(); + if ( $venues ): + foreach ( $venues as $venue ): + $venue_ids[] = $venue->term_id; + endforeach; + endif; endif; $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true ); $url = get_post_meta( $post->ID, 'sp_url', true ); ?> + +
+ +
+ +
+