url_is_accessable_via_ssl() – Determines if the URL can be accessed over SSL.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$bool = url_is_accessable_via_ssl( $url );

Parameters

$url
( string ) required – The URL to test.

Returns

bool Whether SSL access is available.

Source

File name: wordpress/wp-includes/deprecated.php
Lines:

1 to 14 of 14
function url_is_accessable_via_ssl( $url ) {
  _deprecated_function( url_is_accessable_via_ssl, '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;
}
 

 View on GitHub View on Trac