Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Embed::is_valid_urlprivateWC 1.0

Validate URL using both filter_var and wp_http_validate_url.

Method of the class: Embed{}

No Hooks.

Returns

true|false. True if URL is valid.

Usage

// private - for code of main (parent) class only
$result = $this->is_valid_url( $url ): bool;
$url(string) (required)
URL to validate.

Embed::is_valid_url() code WC 10.9.3

private function is_valid_url( string $url ): bool {
	return ! empty( $url ) && filter_var( $url, FILTER_VALIDATE_URL ) && wp_http_validate_url( $url );
}