wc_is_external_resource()
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() wc is external resource code WC 9.3.1
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 ); }