Only show welcome screen on major version upgrade
This commit is contained in:
@@ -383,7 +383,7 @@ class SP_Admin_Welcome {
|
|||||||
public function welcome() {
|
public function welcome() {
|
||||||
|
|
||||||
// Bail if no activation redirect transient is set
|
// Bail if no activation redirect transient is set
|
||||||
if ( ! get_transient( '_sp_activation_redirect' ) )
|
if ( ! get_transient( '_sp_activation_redirect' ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Delete the redirect transient
|
// Delete the redirect transient
|
||||||
|
|||||||
@@ -85,8 +85,20 @@ class SP_Install {
|
|||||||
// Flush rules after install
|
// Flush rules after install
|
||||||
flush_rewrite_rules();
|
flush_rewrite_rules();
|
||||||
|
|
||||||
// Redirect to welcome screen
|
// Get current major version
|
||||||
set_transient( '_sp_activation_redirect', 1, 60 * 60 );
|
$version = explode( '.', $current_version, 3 );
|
||||||
|
unset( $version[2] );
|
||||||
|
$major_current_version = implode( '.', $version );
|
||||||
|
|
||||||
|
// Get new major version
|
||||||
|
$version = explode( '.', SP()->version, 3 );
|
||||||
|
unset( $version[2] );
|
||||||
|
$major_version = implode( '.', $version );
|
||||||
|
|
||||||
|
// Redirect to welcome screen if major version has changed
|
||||||
|
if ( $major_current_version !== $major_version ) {
|
||||||
|
set_transient( '_sp_activation_redirect', 1, 60 * 60 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user