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

WC_Cart::check_cart_item_validity() public WC 1.0

Looks through cart items and checks the posts are not trashed or deleted.

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

Хуков нет.

Возвращает

true/false/WP_Error.

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

$WC_Cart = new WC_Cart();
$WC_Cart->check_cart_item_validity();

Код WC Cart::check cart item validity: woocommerce/includes/class-wc-cart.php WC 4.5.2

<?php
public function check_cart_item_validity() {
	$return = true;

	foreach ( $this->get_cart() as $cart_item_key => $values ) {
		$product = $values['data'];

		if ( ! $product || ! $product->exists() || 'trash' === $product->get_status() ) {
			$this->set_quantity( $cart_item_key, 0 );
			$return = new WP_Error( 'invalid', __( 'An item which is no longer available was removed from your cart.', 'woocommerce' ) );
		}
	}

	return $return;
}