Automattic\WooCommerce\Internal\Caches

ProductVersionStringInvalidator::handle_save_post_productpublicWC 10.5.0

Handle the save_post_product hook.

Method of the class: ProductVersionStringInvalidator{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ProductVersionStringInvalidator = new ProductVersionStringInvalidator();
$ProductVersionStringInvalidator->handle_save_post_product( $post_id ): void;
$post_id(int) (required)
The post ID.

Changelog

Since 10.5.0 Introduced.

ProductVersionStringInvalidator::handle_save_post_product() code WC 10.8.1

public function handle_save_post_product( $post_id ): void {
	$post_id = (int) $post_id;

	if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) {
		return;
	}

	$this->invalidate( $post_id );
}