
网络开发中的Git:了解一个项目的典型工作流程
url_is_accessable_via_ssl ( $url )
url_is_accessable_via_ssl: 这个函数检查一个URL是否可以通过SSL(安全套接字层)访问。
确定URL是否可以通过SSL访问。
通过使用WordPress的HTTP API访问URL,确定是否可以通过SSL访问该URL,使用https作为方案。
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; }