wpinv_status_{$new_status}
Fires after an invoice status has been changed from one status to another.
do_action( 'wpinv_status_' . $new_status, int $invoice_id, string $old_status );
$new_status refer to the new invoice status.
Parameters
- $invoice_id
-
(int) The Invoice ID.
- $old_status
-
(string) Invoice old status. Learn more
Examples
Handle event on invoice status has been changed to Paid(publish).
function _wpi_wpinv_status_paid( $invoice_id, $old_status ) { // Invoice object $invoice = wpinv_get_invoice( $invoice_id ); // Invoice items $cart_items = $invoice->get_cart_details(); // Do your stuff here } add_action( 'wpinv_status_publish', '_wpi_wpinv_status_paid', 10, 2 );