All hooks are prefixed wcoffers_. Actions let you react to events:
| Action | Arguments | Fires when |
|---|---|---|
wcoffers_offer_sent | $offer | A seller sends an offer to a customer. |
wcoffers_offer_status_changed | $offer, $from, $to | Any offer status transition (send, accept, purchase, cancel, expire…). Statuses are the wco-* keys from Statuses & Lifecycle. |
wcoffers_request_created | $request | A customer submits a request. |
wcoffers_request_viewed | $request | The seller opens a request for the first time. |
wcoffers_request_rejected | $request | The seller rejects a request. |
wcoffers_before_boot / wcoffers_booted | $plugin | Around plugin service registration, for advanced integrations. |
Example: ping a webhook whenever an offer is purchased
add_action( 'wcoffers_offer_status_changed', function ( $offer, $from, $to ) {
if ( 'wco-purchased' === $to ) {
wp_remote_post( 'https://example.com/webhook', array(
'body' => array( 'offer_id' => $offer->get_id() ),
) );
}
}, 10, 3 );
