wpinv_update_status
Fires after an invoice status has been changed from one status to another.
do_action( 'wpinv_update_status', int $invoice_id, string $new_status, string $old_status );
Parameters
- $invoice_id
-
(int) The Invoice ID.
- $new_status
-
(string) Invoice new status. Learn more
- $old_status
-
(string) Invoice old status. Learn more
Examples
Simple example to handle invoice status has been changed.
function _wpi_wpinv_update_status( $invoice_id, $new_status, $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_update_status', '_wpi_wpinv_update_status', 10, 3 );