A WordPress-centric search engine for devs and theme authors



filter_ssl ›

Since2.8.5
Deprecatedn/a
filter_ssl ( $url )
Parameters:
  • (string) $url URL
    Required: Yes
Returns:
  • (string) URL with https as the scheme
Defined at:
Codex:

Formats a URL to use https.

Useful as a filter.



Source

function filter_SSL( $url ) {
	if ( ! is_string( $url ) ) {
		return get_bloginfo( 'url' ); // Return home blog url with proper scheme
	}

	if ( force_ssl_content() && is_ssl() ) {
		$url = set_url_scheme( $url, 'https' );
	}

	return $url;
}