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.9.8.1

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
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    * @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
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
         * @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
    097
    098
    099
    100
    101
    102
    103
    104
    105
    106
    107
    * @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 ) );