woocommerce_rest_insert_tax_class

woocommerce_rest_insert_tax_class

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

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_rest_insert_tax_class') is found 1 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-tax-classes-v1-controller.php line 188
    		 * @param stdClass        $tax_class Data used to create the tax class.
    		 * @param WP_REST_Request $request   Request object.
    		 * @param boolean         $creating  True when creating tax class, false when updating tax class.
    		 */
    		do_action( 'woocommerce_rest_insert_tax_class', (object) $tax_class, $request, true );
    
    		$request->set_param( 'context', 'edit' );
    		$response = $this->prepare_item_for_response( $tax_class, $request );
    		$response = rest_ensure_response( $response );
    		$response->set_status( 201 );
    		$response->header( 'Location', rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $tax_class['slug'] ) ) );