Add options to display competition and season in player details
This commit is contained in:
@@ -106,6 +106,22 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
'id' => 'sportspress_player_show_past_teams',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
'checkboxgroup' => '',
|
||||
),
|
||||
|
||||
array(
|
||||
'desc' => __( 'Competitions', 'sportspress' ),
|
||||
'id' => 'sportspress_player_show_leagues',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'checkboxgroup' => '',
|
||||
),
|
||||
|
||||
array(
|
||||
'desc' => __( 'Seasons', 'sportspress' ),
|
||||
'id' => 'sportspress_player_show_seasons',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'checkboxgroup' => 'end',
|
||||
),
|
||||
|
||||
|
||||
@@ -22,6 +22,26 @@ class SP_Player extends SP_Custom_Post {
|
||||
return get_the_terms( $this->ID, 'sp_position' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns leagues
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function leagues() {
|
||||
return get_the_terms( $this->ID, 'sp_league' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns seasons
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function seasons() {
|
||||
return get_the_terms( $this->ID, 'sp_season' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current teams
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user