woocommerce_rest_insert_product_attribute

woocommerce_rest_insert_product_attribute

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_rest_insert_product_attribute') is found 3 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/Version1/class-wc-rest-product-attributes-v1-controller.php line 369
    		 * @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, false );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $attribute, $request );
    
    		return rest_ensure_response( $response );
    	}
    
  • /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 ) );