Added explanation comments.

This commit is contained in:
Peter Fabian 2020-02-07 12:58:31 +01:00
parent 0eb758b8e2
commit 4f485a14de
2 changed files with 5 additions and 0 deletions

View File

@ -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' ) );
}

View File

@ -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;
}