diff --git a/includes/admin/settings/class-sp-settings-general.php b/includes/admin/settings/class-sp-settings-general.php index 058d1e3a..64dc3c10 100644 --- a/includes/admin/settings/class-sp-settings-general.php +++ b/includes/admin/settings/class-sp-settings-general.php @@ -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(