WC_Brands::reset_layered_nav_counts_on_status_changepublicWC 1.0

Reset Layered Nav cached counts on product status change.

Method of the class: WC_Brands{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Brands = new WC_Brands();
$WC_Brands->reset_layered_nav_counts_on_status_change( $new_status, $old_status, $post );
$new_status(required)
.
$old_status(required)
.
$post(required)
.

WC_Brands::reset_layered_nav_counts_on_status_change() code WC 10.5.0

function reset_layered_nav_counts_on_status_change( $new_status, $old_status, $post ) {
	if ( $post->post_type === 'product' && $old_status !== $new_status ) {
		$this->invalidate_wc_layered_nav_counts_cache();
	}
}