WC_Template_Loader::init()public staticWC 1.0

Hook in methods.

{} It's a method of the class: WC_Template_Loader{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Template_Loader::init();

Code of WC_Template_Loader::init() WC 6.7.0

public static function init() {
	self::$theme_support = wc_current_theme_supports_woocommerce_or_fse();
	self::$shop_page_id  = wc_get_page_id( 'shop' );

	// Supported themes.
	if ( self::$theme_support ) {
		add_filter( 'template_include', array( __CLASS__, 'template_loader' ) );
		add_filter( 'comments_template', array( __CLASS__, 'comments_template_loader' ) );

		// Loads gallery scripts on Product page for FSE themes.
		if ( wc_current_theme_is_fse_theme() ) {
			self::add_support_for_product_page_gallery();
		}
	} else {
		// Unsupported themes.
		add_action( 'template_redirect', array( __CLASS__, 'unsupported_theme_init' ) );
	}
}