wc_is_external_resource()WC 3.2.0

See if a resource is remote.

No Hooks.

Return

true|false.

Usage

wc_is_external_resource( $url );
$url(string) (required)
URL to check.

Changelog

Since 3.2.0 Introduced.

wc_is_external_resource() code WC 8.7.0

function wc_is_external_resource( $url ) {
	$wp_base = str_replace( array( 'http://', 'https://' ), '//', get_home_url( null, '/', 'http' ) );

	return strstr( $url, '://' ) && ! strstr( $url, $wp_base );
}