url_is_accessable_via_ssl() - WordPress 函数参考中文文档

返回介绍

url_is_accessable_via_ssl()

发布于 2017-09-11 字数1742 浏览 821 评论 0

Warning: This function has been deprecated.

url_is_accessable_via_ssl( string $url )

Determines if the URL can be accessed over SSL.


描述

Determines if the URL can be accessed over SSL by using the WordPress HTTP API to access the URL using https as the scheme.


参数

$url

(string)
(Required)
The URL to test.


返回值

(bool) Whether SSL access is available.


源代码

File: wp-includes/deprecated.php

function url_is_accessable_via_ssl( $url ) {
	_deprecated_function( __FUNCTION__, '4.0.0' );

	$response = wp_remote_get( set_url_scheme( $url, 'https' ) );

	if ( !is_wp_error( $response ) ) {
		$status = wp_remote_retrieve_response_code( $response );
		if ( 200 == $status || 401 == $status ) {
			return true;
		}
	}

	return false;
}

更新日志

Version 描述
4.0.0 This function has been deprecated.
2.5.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/link-template.php:
    set_url_scheme()
  • wp-includes/http.php:
    wp_remote_get()
  • wp-includes/http.php:
    wp_remote_retrieve_response_code()
  • wp-includes/load.php:
    is_wp_error()

User Contributed Notes

上一篇:urlencode_deep()

下一篇:url_shorten()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!