wp_is_using_https

函数
wp_is_using_https ( No parameters )
返回值
  • (bool) True if using HTTPS, false otherwise.
相关
  • wp_is_home_url_using_https()
  • wp_is_site_url_using_https()
定义位置
相关方法
wp_is_site_url_using_httpswp_is_home_url_using_httpswp_using_themeswp_get_httpwp_get_single_post
引入
5.7.0
弃用
-

Checks whether the website is using HTTPS.

This is based on whether both the home and site URL are using HTTPS.

function wp_is_using_https() {
	if ( ! wp_is_home_url_using_https() ) {
		return false;
	}

	return wp_is_site_url_using_https();
}