Automattic\WooCommerce\Internal\ComingSoon

ComingSoonHelper::is_url_coming_soon()publicWC 1.0

Returns true when the provided URL is behind a coming soon screen.

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

Хуков нет.

Возвращает

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

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

$ComingSoonHelper = new ComingSoonHelper();
$ComingSoonHelper->is_url_coming_soon( $url ): bool;
$url(строка) (обязательный)
The URL to check.

Код ComingSoonHelper::is_url_coming_soon() WC 9.7.1

public function is_url_coming_soon( string $url ): bool {
	// Early exit if coming soon mode not active.
	if ( $this->is_site_live() ) {
		return false;
	}

	if ( $this->is_site_coming_soon() ) {
		return true;
	}

	// Check the URL is a store page when in "store coming soon" mode.
	if ( $this->is_store_coming_soon() && WCAdminHelper::is_store_page( $url ) ) {
		return true;
	}

	// Default to false.
	return false;
}