nShift - Hooks (Actions)
Hooks in WordPress essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.
Response Action
Action: 'ac_wc_unifaun_shipment_response_body'
Parameters:
$body
Object containing callback data from Unifaun
$response
Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order
A WC_Order
object related to the order.
Description: Fired when a calls to Unifaun was successfully
Print Response Action
Action: 'ac_wc_unifaun_shipment_print_response_body'
Parameters:
$body
Object containing callback data from Unifaun
$response
Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order
A WC_Order
object related to the order.
Description: Fired when a shipment was completed/printed, $body contains the tracking IDs etc
Successful Print Action
Action: 'ac_wc_unifaun_shipment_print_successful_print'
Parameters:
$body
Object containing callback data from Unifaun
$response
Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order
A WC_Order
object related to the order.
Description: Fired when a shipment was completed/printed after the meta has been saved
Return shipment Response Action
Action: 'ac_wc_unifaun_shipment_return_response_body'
Parameters:
$body
Object containing callback data from Unifaun
$response
Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order
A WC_Order
object related to the order.
Description: Fired when a shipment was completed/printed after the meta has been saved