Automattic\WooCommerce\Internal\ComingSoon

ComingSoonRequestHandler::initpublicWC 1.0

Sets up the hook.

Метод класса: ComingSoonRequestHandler{}

Хуков нет.

Возвращает

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

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

$ComingSoonRequestHandler = new ComingSoonRequestHandler();
$ComingSoonRequestHandler->init( $coming_soon_helper );
$coming_soon_helper(ComingSoonHelper) (обязательный)
Dependency.

Код ComingSoonRequestHandler::init() WC 10.5.0

final public function init( ComingSoonHelper $coming_soon_helper ) {
	$this->coming_soon_helper = $coming_soon_helper;
	// Hook into plugins_loaded to ensure features are initialized to determine coming soon status.
	add_action(
		'plugins_loaded',
		function () {
			// Skip if the site is live.
			if ( $this->coming_soon_helper->is_site_live() ) {
				return;
			}

			add_filter( 'template_include', array( $this, 'handle_template_include' ) );
			add_filter( 'wp_theme_json_data_theme', array( $this, 'experimental_filter_theme_json_theme' ) );
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
			add_action( 'after_setup_theme', array( $this, 'possibly_init_block_templates' ), 999 );
		}
	);
}