diff --git a/templates/event-details.php b/templates/event-details.php index 9433d33e..251a337a 100644 --- a/templates/event-details.php +++ b/templates/event-details.php @@ -15,20 +15,19 @@ if ( ! isset( $id ) ) $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $date = get_the_time( get_option('date_format'), $id ); $time = get_the_time( get_option('time_format'), $id ); -$leagues = get_the_terms( $id, 'sp_league' ); -$seasons = get_the_terms( $id, 'sp_season' ); $data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time ); -if ( $leagues ): - $league = array_shift( $leagues ); - $data[ __( 'League', 'sportspress' ) ] = $league->name; -endif; +$taxonomies = apply_filters( 'sportspress_event_taxonomies', array( 'sp_league' => null, 'sp_season' => null ) ); -if ( $seasons ): - $season = array_shift( $seasons ); - $data[ __( 'Season', 'sportspress' ) ] = $season->name; -endif; +foreach ( $taxonomies as $taxonomy => $post_type ): + $terms = get_the_terms( $id, $taxonomy ); + if ( $terms ): + $obj = get_taxonomy( $taxonomy ); + $term = array_shift( $terms ); + $data[ $obj->labels->singular_name ] = $term->name; + endif; +endforeach; ?>

@@ -50,5 +49,4 @@ endif;
- -
\ No newline at end of file + \ No newline at end of file diff --git a/templates/event-performance.php b/templates/event-performance.php index 5f537153..f7da6f0c 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 1.3 + * @version 1.3.2 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -214,7 +214,6 @@ if ( is_array( $teams ) ): -
-
-
\ No newline at end of file + \ No newline at end of file diff --git a/templates/event-venue.php b/templates/event-venue.php index 3cc000eb..34988d7f 100644 --- a/templates/event-venue.php +++ b/templates/event-venue.php @@ -56,5 +56,4 @@ foreach( $venues as $venue ): -
\ No newline at end of file +?> \ No newline at end of file diff --git a/templates/event-video.php b/templates/event-video.php index fdde5f74..f8b8dbe1 100644 --- a/templates/event-video.php +++ b/templates/event-video.php @@ -23,5 +23,4 @@ if ( $video_url ): -
\ No newline at end of file +?> \ No newline at end of file diff --git a/templates/player-details.php b/templates/player-details.php index e48b736f..cf775c0e 100644 --- a/templates/player-details.php +++ b/templates/player-details.php @@ -14,6 +14,7 @@ if ( ! isset( $id ) ) $defaults = array( 'show_nationality_flags' => get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false, + 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); @@ -49,7 +50,7 @@ if ( $current_teams ): foreach ( $current_teams as $team ): $teams[] = '' . get_the_title( $team ) . ''; endforeach; - $label = _n( 'Current Team', 'Current Teams', count( $teams ) ); + $label = _n( 'Current Team', 'Current Teams', count( $teams ), 'sportspress' ); $data[ $label ] = implode( ', ', $teams ); endif; @@ -71,6 +72,5 @@ foreach( $data as $label => $value ): endforeach; $output .= ''; -?> - -
\ No newline at end of file + +echo $output; diff --git a/templates/player-statistics.php b/templates/player-statistics.php index 110be4bc..a0ab5b3b 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -67,5 +67,3 @@ if ( is_array( $leagues ) ): -
\ No newline at end of file diff --git a/templates/staff-details.php b/templates/staff-details.php index 3272f7b6..2b139737 100644 --- a/templates/staff-details.php +++ b/templates/staff-details.php @@ -56,5 +56,4 @@ $output .= ''; ?>
-
-
\ No newline at end of file + \ No newline at end of file diff --git a/templates/team-lists.php b/templates/team-lists.php index dd1efa14..48fe5de1 100644 --- a/templates/team-lists.php +++ b/templates/team-lists.php @@ -31,5 +31,3 @@ foreach ( $lists as $list ): else sp_get_template( 'player-list.php', array( 'id' => $id ) ); endforeach; -?> -
\ No newline at end of file diff --git a/templates/team-tables.php b/templates/team-tables.php index 4b0eed16..d5c74e68 100644 --- a/templates/team-tables.php +++ b/templates/team-tables.php @@ -26,5 +26,3 @@ foreach ( $tables as $table ): sp_get_template( 'league-table.php', array( 'id' => $table->ID, 'highlight' => $id ) ); endforeach; -?> -
\ No newline at end of file