Putting public functions back.

In case some plugins are using them.
This commit is contained in:
Peter Fabian 2018-05-02 22:07:49 +02:00
parent 084e4885da
commit 04dd99613e
1 changed files with 25 additions and 0 deletions

View File

@ -1997,6 +1997,31 @@ function wc_delete_expired_transients() {
}
add_action( 'woocommerce_installed', 'wc_delete_expired_transients' );
/**
* Make a URL relative, if possible.
*
* @since 3.2.0
* @param string $url URL to make relative.
* @return string
*/
function wc_get_relative_url( $url ) {
return wc_is_external_resource( $url ) ? $url : str_replace( array( 'http://', 'https://' ), '//', $url );
}
/**
* See if a resource is remote.
*
* @since 3.2.0
* @param string $url URL to check.
* @return bool
*/
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 );
}
/**
* See if theme/s is activate or not.
*