woocommerce_rest_insert_product_attribute, $attribute, $request, true

woocommerce_rest_insert_product_attribute, $attribute, $request, true

Appears in:
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.11.0.0

do_action('woocommerce_rest_insert_product_attribute, $attribute, $request, true') is found 2 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller.php line 299
    		 * @param stdObject       $attribute Inserted attribute object.
    		 * @param WP_REST_Request $request   Request object.
    		 * @param boolean         $creating  True when creating attribute, false when updating.
    		 */
    		do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, true );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $attribute, $request );
    		$response = rest_ensure_response( $response );
    		$response->set_status( 201 );
    		$response->header( 'Location', rest_url( '/' . $this->namespace . '/' . $this->rest_base . '/' . $attribute->attribute_id ) );
    
  • /includes/rest-api/Controllers/Version3/class-wc-rest-product-attributes-controller.php line 101
    		 * @param stdObject       $attribute Inserted attribute object.
    		 * @param WP_REST_Request $request   Request object.
    		 * @param boolean         $creating  True when creating attribute, false when updating.
    		 */
    		do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, true );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $attribute, $request );
    		$response = rest_ensure_response( $response );
    		$response->set_status( 201 );
    		$response->header( 'Location', rest_url( '/' . $this->namespace . '/' . $this->rest_base . '/' . $attribute->attribute_id ) );