WordPress at Your Fingertips
function is not described

WC_Regenerate_Images::maybe_regenerate_images() public WC 1.0

Regenerate images if the settings have changed since last re-generation.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Regenerate_Images::maybe_regenerate_images();

Code of WC_Regenerate_Images::maybe_regenerate_images() WC 5.9.0

public static function maybe_regenerate_images() {
	$size_hash = md5(
		wp_json_encode(
			array(
				wc_get_image_size( 'thumbnail' ),
				wc_get_image_size( 'single' ),
				wc_get_image_size( 'gallery_thumbnail' ),
			)
		)
	);

	if ( update_option( 'woocommerce_maybe_regenerate_images_hash', $size_hash ) ) {
		// Size settings have changed. Trigger regen.
		self::queue_image_regeneration();
	}
}