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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: