Automattic\WooCommerce\Internal\ProductFilters

CacheController::delete_filter_data_transientspublicWC 1.0

Delete all filter data transients.

Method of the class: CacheController{}

No Hooks.

Returns

null. Nothing (null).

Usage

$CacheController = new CacheController();
$CacheController->delete_filter_data_transients(): void;

CacheController::delete_filter_data_transients() code WC 10.8.1

public function delete_filter_data_transients(): void {
	if ( ! $this->need_cleanup() ) {
		return;
	}

	global $wpdb;
	$wpdb->query(
		$wpdb->prepare(
			"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
			$wpdb->esc_like( '_transient_wc_filter_data_' ) . '%',
			$wpdb->esc_like( '_transient_timeout_wc_filter_data_' ) . '%'
		)
	);
}