diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
index ca39b517..c7edd959 100644
--- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
+++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
@@ -53,20 +53,24 @@ class SP_Meta_Box_Event_Teams {
sp_dropdown_taxonomies( $args );
?>
-
- 'sp_team',
- 'name' => 'sp_team[]',
- 'class' => 'sportspress-pages',
- 'show_option_none' => __( '— None —', 'sportspress' ),
- 'show_option_all' => __( '— Individual —', 'sportspress' ),
- 'values' => 'ID',
- 'selected' => $team,
- );
- sp_dropdown_pages( $args );
- ?>
-
+
+
+ 'sp_team',
+ 'name' => 'sp_team[]',
+ 'class' => 'sportspress-pages',
+ 'show_option_none' => __( '— None —', 'sportspress' ),
+ 'show_option_all' => __( '— Individual —', 'sportspress' ),
+ 'values' => 'ID',
+ 'selected' => $team,
+ );
+ sp_dropdown_pages( $args );
+ ?>
+
+
+
+
@@ -84,7 +88,9 @@ class SP_Meta_Box_Event_Teams {
* Save meta box data
*/
public static function save( $post_id, $post ) {
- sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
+ if ( 'teams' == get_option( 'sportspress_mode', 'teams' ) ) {
+ sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
+ }
sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) );
}
diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php
index 88407461..1683ee4c 100644
--- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php
+++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php
@@ -97,36 +97,40 @@ class SP_Meta_Box_Player_Statistics {
|
- 'sp_team',
- 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']',
- 'show_option_none' => __( '— None —', 'sportspress' ),
- 'show_option_all' => __( '— Individual —', 'sportspress' ),
- 'sort_order' => 'ASC',
- 'sort_column' => 'menu_order',
- 'selected' => $value,
- 'values' => 'ID',
- 'include' => $teams,
- 'tax_query' => array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'sp_league',
- 'terms' => $league_id,
- 'field' => 'id',
+
+
+ 'sp_team',
+ 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']',
+ 'show_option_none' => __( '— None —', 'sportspress' ),
+ 'show_option_all' => __( '— Individual —', 'sportspress' ),
+ 'sort_order' => 'ASC',
+ 'sort_column' => 'menu_order',
+ 'selected' => $value,
+ 'values' => 'ID',
+ 'include' => $teams,
+ 'tax_query' => array(
+ 'relation' => 'AND',
+ array(
+ 'taxonomy' => 'sp_league',
+ 'terms' => $league_id,
+ 'field' => 'id',
+ ),
+ array(
+ 'taxonomy' => 'sp_season',
+ 'terms' => $div_id,
+ 'field' => 'id',
+ ),
),
- array(
- 'taxonomy' => 'sp_season',
- 'terms' => $div_id,
- 'field' => 'id',
- ),
- ),
- );
- if ( ! sp_dropdown_pages( $args ) ):
- _e( '— None —', 'sportspress' );
- endif;
- ?>
+ );
+ if ( ! sp_dropdown_pages( $args ) ):
+ _e( '— None —', 'sportspress' );
+ endif;
+ ?>
+
+ >
+
|
diff --git a/templates/player-details.php b/templates/player-details.php
index 9d169e56..44b74f60 100644
--- a/templates/player-details.php
+++ b/templates/player-details.php
@@ -46,26 +46,30 @@ $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );
$data = array_merge( $metrics_before, $common, $metrics_after );
-if ( $current_teams ):
- $teams = array();
- foreach ( $current_teams as $team ):
- $team_name = get_the_title( $team );
- if ( $link_teams ) $team_name = '' . $team_name . '';
- $teams[] = $team_name;
- endforeach;
- $label = _n( 'Current Team', 'Current Teams', count( $teams ), 'sportspress' );
- $data[ $label ] = implode( ', ', $teams );
-endif;
+if ( 'teams' == get_option( 'sportspress_mode', 'teams' ) ) {
+ if ( $current_teams ):
+ $teams = array();
+ foreach ( $current_teams as $team ):
+ $team_name = get_the_title( $team );
+ if ( $link_teams ) $team_name = '' . $team_name . '';
+ $teams[] = $team_name;
+ endforeach;
+ $label = _n( 'Current Team', 'Current Teams', count( $teams ), 'sportspress' );
+ $data[ $label ] = implode( ', ', $teams );
+ endif;
-if ( $past_teams ):
- $teams = array();
- foreach ( $past_teams as $team ):
- $team_name = get_the_title( $team );
- if ( $link_teams ) $team_name = '' . $team_name . '';
- $teams[] = $team_name;
- endforeach;
- $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
-endif;
+ if ( $past_teams ):
+ $teams = array();
+ foreach ( $past_teams as $team ):
+ $team_name = get_the_title( $team );
+ if ( $link_teams ) $team_name = '' . $team_name . '';
+ $teams[] = $team_name;
+ endforeach;
+ $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
+ endif;
+}
+
+$data = apply_filters( 'sportspress_player_details', $data, $id );
$output = '