woocommerce_rest_insert_product_attribute action-hookWC 1.0

Fires after a single product attribute is created or updated via the REST API.

Usage

add_action( 'woocommerce_rest_insert_product_attribute', 'wp_kama_woocommerce_rest_insert_product_attribute_action', 10, 3 );

/**
 * Function for `woocommerce_rest_insert_product_attribute` action-hook.
 * 
 * @param stdObject       $attribute Inserted attribute object.
 * @param WP_REST_Request $request   Request object.
 * @param boolean         $creating  True when creating attribute, false when updating.
 *
 * @return void
 */
function wp_kama_woocommerce_rest_insert_product_attribute_action( $attribute, $request, $creating ){

	// action...
}
$attribute(stdObject)
Inserted attribute object.
$request(WP_REST_Request)
Request object.
$creating(true|false)
True when creating attribute, false when updating.

Where the hook is called

WC_REST_Product_Attributes_V1_Controller::create_item()
woocommerce_rest_insert_product_attribute
WC_REST_Product_Attributes_V1_Controller::update_item()
woocommerce_rest_insert_product_attribute
WC_REST_Product_Attributes_Controller::create_item()
woocommerce_rest_insert_product_attribute
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller.php 299
do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, true );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller.php 369
do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, false );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-attributes-controller.php 101
do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, true );

Where the hook is used in WooCommerce

Usage not found.