WordPress开发者和主题制作者的搜索引擎



filter_ssl ›

Since2.8.5
已弃用n/a
filter_ssl ( $url )
参数:
  • (string) $url URL
    Required: Yes
返回:
  • (string) URL with https as the scheme
定义在:
文档:

Formats a URL to use https.

Useful as a filter.



源码

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;
}