Add main league and current season settings
This commit is contained in:
@@ -40,6 +40,32 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
|
|
||||||
$presets = SP_Admin_Sports::get_preset_options();
|
$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(
|
$settings = array_merge(
|
||||||
|
|
||||||
array(
|
array(
|
||||||
@@ -56,6 +82,22 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
'type' => 'sport',
|
'type' => 'sport',
|
||||||
'options' => $presets,
|
'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(
|
array(
|
||||||
|
|||||||
Reference in New Issue
Block a user