Add squad number and name option to player details
This commit is contained in:
@@ -58,11 +58,27 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Details', 'sportspress' ),
|
'title' => __( 'Details', 'sportspress' ),
|
||||||
|
'desc' => __( 'Squad Number', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_player_show_number',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Name', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_player_show_name',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
'desc' => __( 'Nationality', 'sportspress' ),
|
'desc' => __( 'Nationality', 'sportspress' ),
|
||||||
'id' => 'sportspress_player_show_nationality',
|
'id' => 'sportspress_player_show_nationality',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => '',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ if ( ! isset( $id ) )
|
|||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
|
'show_number' => get_option( 'sportspress_player_show_number', 'no' ) == 'yes' ? true : false,
|
||||||
|
'show_name' => get_option( 'sportspress_player_show_name', 'no' ) == 'yes' ? true : false,
|
||||||
'show_nationality' => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false,
|
'show_nationality' => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false,
|
||||||
'show_positions' => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false,
|
'show_positions' => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false,
|
||||||
'show_current_teams' => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false,
|
'show_current_teams' => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false,
|
||||||
@@ -36,6 +38,14 @@ $metrics_after = $player->metrics( false );
|
|||||||
|
|
||||||
$common = array();
|
$common = array();
|
||||||
|
|
||||||
|
if ( $show_number ):
|
||||||
|
$common[ '#' ] = $player->number;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( $show_name ):
|
||||||
|
$common[ __( 'Name', 'sportspress' ) ] = $player->post->post_title;
|
||||||
|
endif;
|
||||||
|
|
||||||
if ( $show_nationality ):
|
if ( $show_nationality ):
|
||||||
$nationalities = $player->nationalities();
|
$nationalities = $player->nationalities();
|
||||||
if ( $nationalities && is_array( $nationalities ) ):
|
if ( $nationalities && is_array( $nationalities ) ):
|
||||||
|
|||||||
Reference in New Issue
Block a user