filter_SSL

Definition:
function filter_SSL( $url ) {}

Formats an String URL to use HTTPS if HTTP is found.
Useful as a filter.

Parameters

  • $url

Source code

function filter_SSL( $url ) {

	if ( !is_string( $url ) )

		return get_bloginfo( 'url' ); //return home blog url with proper scheme



	$arrURL = parse_url( $url );



	if ( force_ssl_content() && is_ssl() ) {

		if ( 'http' === $arrURL['scheme'] && 'https' !== $arrURL['scheme'] )

			$url = str_replace( $arrURL['scheme'], 'https', $url );

	}



	return $url;

}

1068

No comments yet... Be the first to leave a reply!

Leave a comment