Created
June 10, 2013 17:07
-
-
Save wpsmith/5750471 to your computer and use it in GitHub Desktop.
Conditionally add https scheme to URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'shopp_url', 'wps_force_ssl_shopp_urls', 999 ); | |
/** | |
* Conditionally add https scheme to URLs. | |
* | |
* @param string $url URL string. | |
* | |
* @return string $url Maybe modified URL. | |
*/ | |
function wps_force_ssl_shopp_urls( $url ) { | |
if ( false === strpos( 'https', $url ) ) return str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment