Automattic\WooCommerce\Blocks\Templates
ClassicTemplatesCompatibility::init
Initialization method.
Method of the class: ClassicTemplatesCompatibility{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->init();
ClassicTemplatesCompatibility::init() ClassicTemplatesCompatibility::init code WC 10.3.3
protected function init() { // phpcs:ignore WooCommerce.Functions.InternalInjectionMethod.MissingPublic
if ( ! wp_is_block_theme() ) {
add_action( 'template_redirect', array( $this, 'set_classic_template_data' ) );
// We need to set this data on the widgets screen so the filters render previews.
add_action( 'load-widgets.php', array( $this, 'set_filterable_product_data' ) );
}
}