1. Home
  2. Developers
  3. 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 );



(int) The Invoice ID.


(string) Invoice new status. Learn more


(string) Invoice old status. Learn more


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 );
Was this helpful to you? Yes No 1