Added explanation comments.
This commit is contained in:
parent
0eb758b8e2
commit
4f485a14de
|
@ -49,6 +49,9 @@ class WC_Admin_Notices {
|
|||
add_action( 'switch_theme', array( __CLASS__, 'reset_admin_notices' ) );
|
||||
add_action( 'woocommerce_installed', array( __CLASS__, 'reset_admin_notices' ) );
|
||||
add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) );
|
||||
// @TODO: This prevents Action Scheduler async jobs from storing empty list of notices during WC installation.
|
||||
// That could lead to OBW not starting and 'Run setup wizard' notice not appearing in WP admin, which we want
|
||||
// to avoid.
|
||||
if ( ! WC_Install::is_new_install() || ! wc_is_running_from_async_action_scheduler() ) {
|
||||
add_action( 'shutdown', array( __CLASS__, 'store_notices' ) );
|
||||
}
|
||||
|
|
|
@ -127,6 +127,8 @@ class WC_Admin {
|
|||
* For setup wizard, transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
|
||||
*/
|
||||
public function admin_redirects() {
|
||||
// Don't run this fn from Action Scheduler requests, as it would clear _wc_activation_redirect transient.
|
||||
// That means OBW would never be shown.
|
||||
if ( wc_is_running_from_async_action_scheduler() ) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue