Reflect player link setting when individual mode

This commit is contained in:
Brian Miyaji
2015-09-18 12:20:03 +10:00
parent cefbd283f2
commit ce879e88b2

View File

@@ -57,6 +57,7 @@ class SportsPress_Individual_Mode {
add_filter( 'sportspress_list_team_selector', '__return_false' );
add_filter( 'pre_option_sportspress_event_split_players_by_team', array( $this, 'no' ) );
add_filter( 'pre_option_sportspress_event_show_status', array( $this, 'no' ) );
add_filter( 'pre_option_sportspress_link_teams', array( $this, 'link_players' ) );
add_filter( 'sportspress_has_teams', '__return_false' );
add_action( 'admin_head', array( $this, 'menu_highlight' ) );
}
@@ -82,6 +83,13 @@ class SportsPress_Individual_Mode {
return 'no';
}
/**
* Return link players instead of teams.
*/
public function link_players() {
return get_option( 'sportspress_link_players', 'yes' );
}
public function save_player_meta( $post_id, $post ) {
if ( isset( $_POST['sp_team'] ) && is_array( $_POST['sp_team'] ) ) {
$players = array();