wpseek.com
A WordPress-centric search engine for devs and theme authors



filter_ssl › WordPress Function

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 ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	if ( ! is_string( $url ) ) {
		return get_bloginfo( 'url' ); // Return home site URL with proper scheme.
	}

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

	return $url;
}