W3cubDocs

/WordPress

wp_is_stream( string $path )

Test if a given path is a stream URL

Parameters

$path

(string) (Required) The resource path or URL.

Return

(bool) True if the path is a stream URL.

Source

File: wp-includes/functions.php

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 );
}

Changelog

Version Description
3.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_stream