get_status(), self::NOTIFIABLE_STATUSES, true ) ) { return; } wc_get_container()->get( PendingNotificationStore::class )->add( new NewOrderNotification( $order_id ) ); } // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed /** * Handles the woocommerce_order_status_changed hook. * * @param int $order_id The order ID. * @param string $previous_status The previous order status. * @param string $next_status The new order status. * @param WC_Order $order The order object. * @return void * * @since 10.7.0 */ public function on_order_status_changed( int $order_id, string $previous_status, string $next_status, WC_Order $order ): void { // phpcs:enable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed if ( in_array( $previous_status, self::NOTIFIABLE_STATUSES, true ) || ! in_array( $next_status, self::NOTIFIABLE_STATUSES, true ) ) { return; } wc_get_container()->get( PendingNotificationStore::class )->add( new NewOrderNotification( $order_id ) ); } }