wp_is_stream()
Tests if a given path is a stream URL
No Hooks.
Returns
true|false. True if the path is a stream URL.
Usage
wp_is_stream( $path );
- $path(string) (required)
- The resource path or URL.
Changelog
| Since 3.5.0 | Introduced. |
wp_is_stream() wp is stream code WP 6.9.1
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 );
}