Don't run setup wizard redirects from AS.
This commit is contained in:
parent
e9b6faa8df
commit
06d0bbefc4
|
@ -127,6 +127,10 @@ 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() {
|
||||
if ( wc_is_running_from_async_action_scheduler() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
// Nonced plugin install redirects (whitelisted).
|
||||
if ( ! empty( $_GET['wc-install-plugin-redirect'] ) ) {
|
||||
|
|
|
@ -2273,3 +2273,13 @@ function wc_load_cart() {
|
|||
WC()->initialize_session();
|
||||
WC()->initialize_cart();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether the context of execution comes from async action scheduler.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @return bool
|
||||
*/
|
||||
function wc_is_running_from_async_action_scheduler() {
|
||||
return isset( $_REQUEST['action'] ) && 'as_async_request_queue_runner' === $_REQUEST['action'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue