is_ssl

函数


is_ssl ( No parameters )
返回值
  • (bool) True if SSL, otherwise false.
定义位置
  • wp-includes/load.php
    , line 1447
引入
2.6.0
弃用

Determines if SSL is used.

function is_ssl() {
	if ( isset( $_SERVER['HTTPS'] ) ) {
		if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) {
			return true;
		}

		if ( '1' == $_SERVER['HTTPS'] ) {
			return true;
		}
	} elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
		return true;
	}
	return false;
}