функция
Устаревший since 2.5.0
url_is_accessable_via_ssl()
Устаревшее.
Помечено устаревшим с версии 4.0.0.
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
url_is_accessable_via_ssl( string $url ): bool
Описание
Определяет, доступен ли URL по SSL, используя HTTP API WordPress для обращения к URL по схеме https.
Оригинал (английский)
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
обязательный
URL для проверки.
Возвращаемое значение
bool
Исходный код
wp-includes/deprecated.php:3485
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;
}
История изменений
| Версия | Описание |
|---|---|
| 4.0.0 | Устаревший. |
| 2.5.0 | Introduced. |

