Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Embed::is_valid_url
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() 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 );
}