filter_ssl

函式
filter_ssl ( $url )
引數
  • (string) $url URL
    Required:
返回值
  • (string) URL with https as the scheme
定義位置
相關方法
wp_filter_ksesis_sslwp_filter_post_ksesapply_filtersadd_filter
引入
2.8.5
棄用
-

filter_ssl – 該過濾器用於修改當前頁面的SSL狀態。它接受SSL狀態作為其引數。

形成一個使用https的URL。

作為一個過濾器很有用。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function filter_SSL( $url ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
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;
}
function filter_SSL( $url ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 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; }
function filter_SSL( $url ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	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;
}

常見問題

FAQs
檢視更多 >