Fix welcome page displaying if preset saved from settings
This commit is contained in:
@@ -161,6 +161,7 @@ class SP_Admin_Welcome {
|
||||
$sport = $_POST['sportspress_sport'];
|
||||
SP_Admin_Sports::apply_preset( $sport );
|
||||
update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
|
||||
delete_option( '_sp_needs_welcome' );
|
||||
update_option( 'sportspress_installed', 1 );
|
||||
?>
|
||||
<div id="message" class="updated sportspress-message">
|
||||
|
||||
@@ -194,7 +194,8 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) !== $_POST['sportspress_sport'] ):
|
||||
$sport = $_POST['sportspress_sport'];
|
||||
SP_Admin_Sports::apply_preset( $sport );
|
||||
update_option( '_sp_needs_welcome', 0 );
|
||||
delete_option( '_sp_needs_welcome' );
|
||||
update_option( 'sportspress_installed', 1 );
|
||||
endif;
|
||||
|
||||
if ( isset( $_POST['add_sample_data'] ) ):
|
||||
|
||||
@@ -54,6 +54,7 @@ class SP_Install {
|
||||
|
||||
// We no longer need to install pages
|
||||
delete_option( '_sp_needs_welcome' );
|
||||
update_option( 'sportspress_installed', 1 );
|
||||
delete_transient( '_sp_activation_redirect' );
|
||||
|
||||
// What's new redirect
|
||||
@@ -65,6 +66,7 @@ class SP_Install {
|
||||
|
||||
// We no longer need to install configs
|
||||
delete_option( '_sp_needs_welcome' );
|
||||
update_option( 'sportspress_installed', 1 );
|
||||
delete_transient( '_sp_activation_redirect' );
|
||||
|
||||
// What's new redirect
|
||||
|
||||
Reference in New Issue
Block a user