Warning: This function has been deprecated.

url_is_accessable_via_ssl() WordPress Function

The url_is_accessable_via_ssl() function is used to check if a given URL can be accessed over SSL. This is useful for checking if a given site can be accessed using HTTPS.

url_is_accessable_via_ssl( string $url ) #

Determines if the URL can be accessed over SSL.


Description

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


Top ↑

Parameters

$url

(string)(Required)The URL to test.


Top ↑

Return

(bool) Whether SSL access is available.


Top ↑

Source

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;
}


Top ↑

Changelog

Changelog
VersionDescription
4.0.0This function has been deprecated.
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More