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