woocommerce_rest_insert_tax хук-событиеWC 1.0

Fires after a tax is created or updated via the REST API.

Использование

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.

Где вызывается хук

WC_REST_Taxes_V1_Controller::create_item()
woocommerce_rest_insert_tax
WC_REST_Taxes_V1_Controller::update_item()
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 );

Где используется хук в WooCommerce

Использование не найдено.