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.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wc_set_hooked_blocks_version();

Список изменений

С версии 9.2.0 Введена.

Код wc_set_hooked_blocks_version() WC 10.5.2

function wc_set_hooked_blocks_version() {
	// Only set the version if the current theme is a block theme.
	if ( ! wp_is_block_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()->stable_version() );
}