woocommerce_rest_insert_tax

woocommerce_rest_insert_tax

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_rest_insert_tax') is found 2 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php line 416
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    * @param stdClass        $tax       Data used to create the tax.
     * @param WP_REST_Request $request   Request object.
     * @param boolean         $creating  True when creating tax, false when updating tax.
     */
    do_action( 'woocommerce_rest_insert_tax', $tax, $request, true );
     
    $request->set_param( 'context', 'edit' );
    $response = $this->prepare_item_for_response( $tax, $request );
    $response = rest_ensure_response( $response );
    $response->set_status( 201 );
    $response->header( 'Location', rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $tax->tax_rate_id ) ) );
  • /includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php line 472
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    * @param stdClass        $tax       Data used to create the tax.
     * @param WP_REST_Request $request   Request object.
     * @param boolean         $creating  True when creating tax, false when updating tax.
     */
    do_action( 'woocommerce_rest_insert_tax', $tax, $request, false );
     
    $request->set_param( 'context', 'edit' );
    $response = $this->prepare_item_for_response( $tax, $request );
    $response = rest_ensure_response( $response );
     
    return $response;