at path:
ROOT
/
wp-content
/
plugins
/
woocommerce
/
src
/
Blocks
/
TemplateOptions.php
run:
R
W
Run
AI
DIR
2026-04-15 05:42:46
R
W
Run
AIContent
DIR
2026-04-15 05:42:46
R
W
Run
Assets
DIR
2026-04-15 05:42:46
R
W
Run
BlockTypes
DIR
2026-04-15 05:42:46
R
W
Run
Domain
DIR
2026-04-15 05:42:46
R
W
Run
Images
DIR
2026-04-15 05:42:46
R
W
Run
Integrations
DIR
2026-04-15 05:42:46
R
W
Run
Patterns
DIR
2026-04-15 05:42:46
R
W
Run
Payments
DIR
2026-04-15 05:42:46
R
W
Run
Registry
DIR
2026-04-15 05:42:46
R
W
Run
SharedStores
DIR
2026-04-15 05:42:46
R
W
Run
Shipping
DIR
2026-04-15 05:42:46
R
W
Run
Templates
DIR
2026-04-15 05:42:46
R
W
Run
Utils
DIR
2026-04-15 05:42:46
R
W
Run
Assets.php
2.77 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
AssetsController.php
19.67 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
BlockPatterns.php
7.92 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
BlockTemplatesController.php
17.98 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
BlockTemplatesRegistry.php
6.3 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
BlockTypesController.php
25.03 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
DependencyDetection.php
10.66 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
InboxNotifications.php
583 By
2026-04-15 05:42:46
R
W
Run
Delete
Rename
Installer.php
4.08 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
Library.php
1.06 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
Options.php
336 By
2026-04-15 05:42:46
R
W
Run
Delete
Rename
Package.php
2.72 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
QueryFilters.php
17.8 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
TemplateOptions.php
1.21 KB
2026-04-15 05:42:46
R
W
Run
Delete
Rename
error_log
up
📄
TemplateOptions.php
Save
<?php declare( strict_types = 1 ); namespace Automattic\WooCommerce\Blocks; use Automattic\WooCommerce\Blocks\Options; /** * TemplateOptions class. * * @internal */ class TemplateOptions { /** * Initialization method. */ public function init() { add_action( 'after_switch_theme', array( $this, 'check_should_use_blockified_product_grid_templates' ), 10, 2 ); } /** * Checks the old and current themes and determines if the "wc_blocks_use_blockified_product_grid_block_as_template" * option need to be updated accordingly. * * @param string $old_name Old theme name. * @param \WP_Theme $old_theme Instance of the old theme. * @return void */ public function check_should_use_blockified_product_grid_templates( $old_name, $old_theme ) { if ( ! $old_theme->is_block_theme() && wp_is_block_theme() ) { $option_name = Options::WC_BLOCK_USE_BLOCKIFIED_PRODUCT_GRID_BLOCK_AS_TEMPLATE; // We previously stored "yes" or "no" values. This will convert them to true or false. $option_value = wc_string_to_bool( get_option( $option_name ) ); // We don't need to do anything if the option is already set to true. if ( ! $option_value ) { update_option( $option_name, true ); } } } }