Determines whether this class can be used for retrieving a URL.
Parameters
$args
arrayoptional- Array of request arguments.
Default:
array()
Source
public static function test( $args = array() ) {
if ( ! function_exists( 'stream_socket_client' ) ) {
return false;
}
$is_ssl = isset( $args['ssl'] ) && $args['ssl'];
if ( $is_ssl ) {
if ( ! extension_loaded( 'openssl' ) ) {
return false;
}
if ( ! function_exists( 'openssl_x509_parse' ) ) {
return false;
}
}
/**
* Filters whether streams can be used as a transport for retrieving a URL.
*
* @since 2.7.0
*
* @param bool $use_class Whether the class can be used. Default true.
* @param array $args Request arguments.
*/
return apply_filters( 'use_streams_transport', true, $args );
}
Hooks
- apply_filters( ‘use_streams_transport’,
bool $use_class ,array $args ) Filters whether streams can be used as a transport for retrieving a URL.
User Contributed Notes
You must log in before being able to contribute a note or feedback.