wc_set_hooked_blocks_version()
Set the version of the hooked blocks in the database. Used when WC is installed for the first time.
No Hooks.
Returns
null. Nothing (null).
Usage
wc_set_hooked_blocks_version();
Changelog
| Since 9.2.0 | Introduced. |
wc_set_hooked_blocks_version() wc set hooked blocks version code WC 10.6.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() );
}