wp_is_stream( string $path ): bool

Tests if a given path is a stream URL


Parameters

$path string Required
The resource path or URL.

Top ↑

Return

bool True if the path is a stream URL.


Top ↑

Source

File: wp-includes/functions.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
3.5.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.