Add mode select to welcome page
This commit is contained in:
@@ -182,6 +182,11 @@ class SP_Admin_Welcome {
|
||||
$sport = $_POST['sportspress_sport'];
|
||||
SP_Admin_Sports::apply_preset( $sport );
|
||||
update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
|
||||
endif;
|
||||
if ( isset( $_POST['sportspress_mode'] ) && ! empty( $_POST['sportspress_mode'] ) && get_option( 'sportspress_mode', null ) != $_POST['sportspress_mode'] ):
|
||||
$sport = $_POST['sportspress_mode'];
|
||||
SP_Admin_Sports::apply_preset( $sport );
|
||||
update_option( 'sportspress_mode', $_POST['sportspress_mode'] );
|
||||
endif;
|
||||
if ( isset( $_POST['sportspress_default_country'] ) ):
|
||||
update_option( 'sportspress_default_country', $_POST['sportspress_default_country'] );
|
||||
@@ -217,6 +222,20 @@ class SP_Admin_Welcome {
|
||||
));
|
||||
SP_Admin_Settings::output_fields( $settings );
|
||||
?>
|
||||
<h4><?php _e( 'Mode', 'sportspress' ); ?></h4>
|
||||
<?php
|
||||
$settings = array( array(
|
||||
'id' => 'sportspress_mode',
|
||||
'default' => 'team',
|
||||
'type' => 'select',
|
||||
'class' => $class,
|
||||
'options' => array(
|
||||
'team' => _x( 'Team', 'mode select', 'sportspress' ),
|
||||
'player' => _x( 'Individual', 'mode select', 'sportspress' ),
|
||||
),
|
||||
));
|
||||
SP_Admin_Settings::output_fields( $settings );
|
||||
?>
|
||||
<p class="submit sportspress-actions">
|
||||
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
|
||||
<input type="hidden" name="subtab" id="last_tab" />
|
||||
|
||||
Reference in New Issue
Block a user