wc_is_external_resource( string $url )

See if a resource is remote.


Description Description


Parameters Parameters

$url

(Required) URL to check.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/wc-core-functions.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.