filter_SSL()
Formats a URL to use https.
Useful as a filter.
No Hooks.
Returns
String. URL with https as the scheme.
Usage
filter_SSL( $url );
- $url(string) (required)
- URL.
Changelog
| Since 2.8.5 | Introduced. |
filter_SSL() filter SSL code WP 7.0
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;
}