wc_set_hooked_blocks_version()WC 9.2.0

Set the version of the hooked blocks in the database. Used when WC is installed for the first time.

No Hooks.

Return

null. Nothing (null).

Usage

wc_set_hooked_blocks_version();

Changelog

Since 9.2.0 Introduced.

wc_set_hooked_blocks_version() code WC 9.4.2

function wc_set_hooked_blocks_version() {
	// Only set the version if the current theme is a block theme.
	if ( ! wc_current_theme_is_fse_theme() && ! current_theme_supports( 'block-template-parts' ) ) {
		return;
	}

	$option_name = 'woocommerce_hooked_blocks_version';

	if ( get_option( $option_name ) ) {
		return;
	}

	add_option( $option_name, WC()->version );
}