woocommerce_rest_insert_tax
Fires after a tax is created or updated via the REST API.
Usage
add_action( 'woocommerce_rest_insert_tax', 'wp_kama_woocommerce_rest_insert_tax_action', 10, 3 ); /** * Function for `woocommerce_rest_insert_tax` action-hook. * * @param stdClass $tax Data used to create the tax. * @param WP_REST_Request $request Request object. * @param boolean $creating True when creating tax, false when updating tax. * * @return void */ function wp_kama_woocommerce_rest_insert_tax_action( $tax, $request, $creating ){ // action... }
- $tax(stdClass)
- Data used to create the tax.
- $request(WP_REST_Request)
- Request object.
- $creating(true|false)
- True when creating tax, false when updating tax.
Where the hook is called
woocommerce_rest_insert_tax
woocommerce_rest_insert_tax
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php 416
do_action( 'woocommerce_rest_insert_tax', $tax, $request, true );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php 472
do_action( 'woocommerce_rest_insert_tax', $tax, $request, false );