Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Created September 16, 2025 07:45
Show Gist options
  • Select an option

  • Save dennisnissle/4dfdbd1d711d431fe41dea95d32340d3 to your computer and use it in GitHub Desktop.

Select an option

Save dennisnissle/4dfdbd1d711d431fe41dea95d32340d3 to your computer and use it in GitHub Desktop.
Send invoice to admin on order status pending to processing
<?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