is_ssl()检查ssl是否可用

目录

描述

Checks if SSL is being used.

is_ssl() 描述

用法

<?php is_ssl() ?>

is_ssl() 用法

参数

This tag has no parameters.

is_ssl() 参数

返回值

(bool) 

Returns true or false

is_ssl() 返回值

示例

is_ssl() 示例

注意

Returns true if the page is using SSL (checks if HTTPS or on Port 443).

NB: this won't work for websites behind some load balancers, especially Network Solutions hosted websites. To bodgy up a fix, save this gist into the plugins folder and enable it. For details, read WordPress is_ssl() doesn’t work behind some load balancers.

Websites behind load balancers or reverse proxies that support HTTP_X_FORWARDED_PROTO can be fixed by adding the following code to the wp-config.php file, above the require_once call:

is_ssl() 注意

历史

添加于 版本: 2.6.0

is_ssl() 历史

源文件

is_ssl() 函数的代码位于 wp-includes/functions.php.

is_ssl() 源文件

相关