WordPress at a glance
function is not described


ReportsSync::clear_stock_count_cache() public WC 1.0

Clear the count cache when products are added or updated, or when the no/low stock options are changed.

{} It's a method of the class: ReportsSync{}

No Hooks.


null. Nothing.


$result = ReportsSync::clear_stock_count_cache( $id );
$id(int) (required)
Post/product ID.

Code of ReportsSync::clear_stock_count_cache() WC 5.2.2

public static function clear_stock_count_cache( $id ) {
	delete_transient( 'wc_admin_stock_count_lowstock' );
	delete_transient( 'wc_admin_product_count' );
	$status_options = wc_get_product_stock_status_options();
	foreach ( $status_options as $status => $label ) {
		delete_transient( 'wc_admin_stock_count_' . $status );