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

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

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

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.

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

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 );

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

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