force_ssl_admin

函数
force_ssl_admin ( $force = null )
参数
  • (string|bool) $force Optional. Whether to force SSL in admin screens. Default null.
    Required:
    Default: null
返回值
  • (bool) True if forced, false if not forced.
定义位置
相关方法
force_ssl_loginforce_ssl_contentis_adminrevoke_super_adminformat_code_lang
引入
2.6.0
弃用
-

force_ssl_admin: 这个函数用于强制对WordPress管理区进行SSL加密。这对于确保敏感的用户数据,如登录凭证,被安全地传输是很重要的。

决定是否强制为管理屏幕使用SSL。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function force_ssl_admin( $force = null ) {
static $forced = false;
if ( ! is_null( $force ) ) {
$old_forced = $forced;
$forced = $force;
return $old_forced;
}
return $forced;
}
function force_ssl_admin( $force = null ) { static $forced = false; if ( ! is_null( $force ) ) { $old_forced = $forced; $forced = $force; return $old_forced; } return $forced; }
function force_ssl_admin( $force = null ) {
	static $forced = false;

	if ( ! is_null( $force ) ) {
		$old_forced = $forced;
		$forced     = $force;
		return $old_forced;
	}

	return $forced;
}

常见问题

FAQs
查看更多 >