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

WC_REST_Tax_Classes_V1_Controller::delete_item() public WC 1.0

Delete a single tax class.

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

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

WP_Error/WP_REST_Response.

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

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

Код WC_REST_Tax_Classes_V1_Controller::delete_item() WC 4.7.0

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

	$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_class = WC_Tax::get_tax_class_by( 'slug', sanitize_title( $request['slug'] ) );
	$deleted   = WC_Tax::delete_tax_class_by( 'slug', sanitize_title( $request['slug'] ) );

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

	if ( is_wp_error( $deleted ) ) {
		return new WP_Error( 'woocommerce_rest_' . $deleted->get_error_code(), $deleted->get_error_message(), array( 'status' => 400 ) );
	}

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

	/**
	 * Fires after a tax class is deleted via the REST API.
	 *
	 * @param stdClass         $tax_class 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', (object) $tax_class, $response, $request );

	return $response;
}