WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_REST_Taxes_V1_Controller::delete_item() public WC 1.0

Delete a single tax.

{} Это метод класса: WC_REST_Taxes_V1_Controller{}

Хуки из метода
Возвращает

WP_Error/WP_REST_Response.

Использование

$WC_REST_Taxes_V1_Controller = new WC_REST_Taxes_V1_Controller();
$WC_REST_Taxes_V1_Controller->delete_item( $request );
$request(WP_REST_Request) (обязательный)
Full details about the request.

Код WC_REST_Taxes_V1_Controller::delete_item() WC 4.7.1

<?php
public function delete_item( $request ) {
	global $wpdb;

	$id    = (int) $request['id'];
	$force = isset( $request['force'] ) ? (bool) $request['force'] : false;

	// We don't support trashing for this type, error out.
	if ( ! $force ) {
		return new WP_Error( 'woocommerce_rest_trash_not_supported', __( 'Taxes do not support trashing.', 'woocommerce' ), array( 'status' => 501 ) );
	}

	$tax = WC_Tax::_get_tax_rate( $id, OBJECT );

	if ( empty( $id ) || empty( $tax ) ) {
		return new WP_Error( 'woocommerce_rest_invalid_id', __( 'Invalid resource ID.', 'woocommerce' ), array( 'status' => 400 ) );
	}

	$request->set_param( 'context', 'edit' );
	$response = $this->prepare_item_for_response( $tax, $request );

	WC_Tax::_delete_tax_rate( $id );

	if ( 0 === $wpdb->rows_affected ) {
		return new WP_Error( 'woocommerce_rest_cannot_delete', __( 'The resource cannot be deleted.', 'woocommerce' ), array( 'status' => 500 ) );
	}

	/**
	 * Fires after a tax is deleted via the REST API.
	 *
	 * @param stdClass         $tax      The tax data.
	 * @param WP_REST_Response $response The response returned from the API.
	 * @param WP_REST_Request  $request  The request sent to the API.
	 */
	do_action( 'woocommerce_rest_delete_tax', $tax, $response, $request );

	return $response;
}