url_is_accessable_via_ssl

Determines if the URL can be accessed over SSL.

Description

url_is_accessable_via_ssl( (string) $url ); 

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

Parameters (1)

0. $url (string)
The URL to test.

Usage

  1. if ( !function_exists( 'url_is_accessable_via_ssl' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The URL to test. 
  5. $url = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = url_is_accessable_via_ssl($url); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function url_is_accessable_via_ssl( $url ) { 
  2. _deprecated_function( __FUNCTION__, '4.0.0' ); 
  3.  
  4. $response = wp_remote_get( set_url_scheme( $url, 'https' ) ); 
  5.  
  6. if ( !is_wp_error( $response ) ) { 
  7. $status = wp_remote_retrieve_response_code( $response ); 
  8. if ( 200 == $status || 401 == $status ) { 
  9. return true; 
  10.  
  11. return false;