Run woocommerce_admin_updated as a scheduled action (https://github.com/woocommerce/woocommerce-admin/pull/8423)
* run woocommerce_admin_updated as a scheduled action * Rename the action
This commit is contained in:
parent
9aba93d127
commit
86b94e64c3
|
@ -39,7 +39,24 @@ class RemoteInboxNotificationsEngine {
|
|||
|
||||
// Hook into WCA updated. This is hooked up here rather than in
|
||||
// on_admin_init because that runs too late to hook into the action.
|
||||
add_action( 'woocommerce_admin_updated', array( __CLASS__, 'run_on_woocommerce_admin_updated' ) );
|
||||
add_action(
|
||||
'woocommerce_admin_updated',
|
||||
function() {
|
||||
$next_hook = WC()->queue()->get_next(
|
||||
'woocommerce_run_on_woocommerce_admin_updated',
|
||||
array( __CLASS__, 'run_on_woocommerce_admin_updated' ),
|
||||
'woocommerce-remote-inbox-engine'
|
||||
);
|
||||
if ( null === $next_hook ) {
|
||||
WC()->queue()->schedule_single(
|
||||
time(),
|
||||
'woocommerce_run_on_woocommerce_admin_updated',
|
||||
array( __CLASS__, 'run_on_woocommerce_admin_updated' ),
|
||||
'woocommerce-remote-inbox-engine'
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue