wp_is_stream

函数


wp_is_stream ( $path )
参数
  • (string)
    $path
    The resource path or URL.
    Required:
返回值
  • (bool) True if the path is a stream URL.
定义位置
  • wp-includes/functions.php
    , line 7027
引入
3.5.0
弃用

Tests if a given path is a stream URL

function wp_is_stream( $path ) {
	$scheme_separator = strpos( $path, '://' );

	if ( false === $scheme_separator ) {
		// $path isn't a stream.
		return false;
	}

	$stream = substr( $path, 0, $scheme_separator );

	return in_array( $stream, stream_get_wrappers(), true );
}