woocommerce_rest_insert_tax

woocommerce_rest_insert_tax

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

See hook in core

Displaying hooks found in version: woocommerce.9.5.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
    		 * @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
    		 * @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;