diff --git a/plugins/woocommerce/changelog/fix-woocommerce_admin_updated-does-not-run b/plugins/woocommerce/changelog/fix-woocommerce_admin_updated-does-not-run new file mode 100644 index 00000000000..3b50bb74c0c --- /dev/null +++ b/plugins/woocommerce/changelog/fix-woocommerce_admin_updated-does-not-run @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Add missing woocommerce_run_on_woocommerce_admin_updated hook for the scheduled action registered in RemoteInboxNotificationsEngine diff --git a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/RemoteInboxNotificationsEngine.php b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/RemoteInboxNotificationsEngine.php index c0372acb429..8365a2f0a24 100644 --- a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/RemoteInboxNotificationsEngine.php +++ b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/RemoteInboxNotificationsEngine.php @@ -40,19 +40,20 @@ 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_run_on_woocommerce_admin_updated', array( __CLASS__, 'run_on_woocommerce_admin_updated' ) ); add_action( 'woocommerce_updated', function() { $next_hook = WC()->queue()->get_next( 'woocommerce_run_on_woocommerce_admin_updated', - array( __CLASS__, 'run_on_woocommerce_admin_updated' ), + array(), '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' ), + array(), 'woocommerce-remote-inbox-engine' ); }