wc_get_relative_url()
Make a URL relative, if possible.
No Hooks.
Returns
String.
Usage
wc_get_relative_url( $url );
- $url(string) (required)
- URL to make relative.
Changelog
| Since 3.2.0 | Introduced. |
wc_get_relative_url() wc get relative url code WC 10.7.0
function wc_get_relative_url( $url ) {
return wc_is_external_resource( $url ) ? $url : str_replace( array( 'http://', 'https://' ), '//', $url );
}