Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created June 10, 2013 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/5750471 to your computer and use it in GitHub Desktop.
Save wpsmith/5750471 to your computer and use it in GitHub Desktop.
Conditionally add https scheme to URLs.
<?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