lib/URLHelper.php
public static function swap_protocol( $url ) {
		if ( stristr($url, 'http:') ) {
			return str_replace('http:', 'https:', $url);
		}
		if ( stristr($url, 'https:') ) {
			return str_replace('https:', 'http:', $url);
		}
		return $url;
	}
public static function swap_protocol( $url ) {
		if ( stristr($url, 'http:') ) {
			return str_replace('http:', 'https:', $url);
		}
		if ( stristr($url, 'https:') ) {
			return str_replace('https:', 'http:', $url);
		}
		return $url;
	}
public static function swap_protocol ( $ url ) { if ( stristr ( $ url , 'http:' ) ) { return str_replace ( 'http:' , 'https:' , $ url ) ; } if ( stristr ( $ url , 'https:' ) ) { return str_replace ( 'https:' , 'http:' , $ url ) ; } return $ url ; }
Swaps whatever protocol of a URL is sent. http becomes https and vice versa
@since 1.3.3
@author jarednova
@param string $url ex: http://example.org/wp-content/uploads/dog.jpg
@return string ex: https://example.org/wp-content/uploads/dog.jpg
Swaps whatever protocol of a URL is sent . http becomes https and vice versa