Automattic\WooCommerce\Internal\ComingSoon

ComingSoonHelper::is_url_coming_soon()publicWC 1.0

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

Method of the class: ComingSoonHelper{}

No Hooks.

Return

null. Nothing (null).

Usage

$ComingSoonHelper = new ComingSoonHelper();
$ComingSoonHelper->is_url_coming_soon( $url ): bool;
$url(string) (required)
The URL to check.

ComingSoonHelper::is_url_coming_soon() code WC 8.9.0

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;
}