Add main league and current season settings

This commit is contained in:
Brian Miyaji
2018-01-22 11:31:49 +11:00
parent fd21316b23
commit e78a259065

View File

@@ -40,6 +40,32 @@ class SP_Settings_General extends SP_Settings_Page {
$presets = SP_Admin_Sports::get_preset_options();
$leagues = array( '' => __( '— Select —', 'sportspress' ) );
$terms = get_terms( array(
'taxonomy' => 'sp_league',
'hide_empty' => false,
) );
if ( $terms ) {
foreach ( $terms as $term ) {
$leagues[ $term->term_id ] = $term->name;
}
}
$seasons = array( '' => __( '— Select —', 'sportspress' ) );
$terms = get_terms( array(
'taxonomy' => 'sp_season',
'hide_empty' => false,
) );
if ( $terms ) {
foreach ( $terms as $term ) {
$seasons[ $term->term_id ] = $term->name;
}
}
$settings = array_merge(
array(
@@ -56,6 +82,22 @@ class SP_Settings_General extends SP_Settings_Page {
'type' => 'sport',
'options' => $presets,
),
array(
'title' => __( 'Main League', 'sportspress' ),
'id' => 'sportspress_league',
'default' => null,
'type' => 'select',
'options' => $leagues,
),
array(
'title' => __( 'Current Season', 'sportspress' ),
'id' => 'sportspress_season',
'default' => null,
'type' => 'select',
'options' => $seasons,
),
)),
array(