Created
September 16, 2025 07:45
-
-
Save dennisnissle/4dfdbd1d711d431fe41dea95d32340d3 to your computer and use it in GitHub Desktop.
Send invoice to admin on order status pending to processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'woocommerce_order_status_pending_to_processing_notification', function( $order_id ) { | |
| if ( $order = sab_get_order( $order_id ) ) { | |
| if ( $invoice = $order->get_latest_finalized_invoice() ) { | |
| $invoice->send_to_admin(); | |
| } | |
| } | |
| }, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment