wp_is_stream( string $path ): bool
- Since
- 3.5.0
- Source
wp-includes/functions.php:7501
Tests if a given path is a stream URL
Parameters
$pathstring- The resource path or URL.
Return
bool- True if the path is a stream URL.
Used by · 9
- WP_Image_Editor::generate_filename()Builds an output filename based on current file, and adding proper suffix
- WP_Image_Editor::make_image()Either calls editor's save function or handles file as a stream.
- WP_Image_Editor_GD::make_image()Either calls editor's save function or handles file as a stream.
- WP_Image_Editor_Imagick::load()Loads image from $this->file into new Imagick Object.
- WP_Image_Editor_Imagick::write_image()Writes an image to a file or stream.
- path_is_absolute()Tests if a given filesystem path is absolute.
- wp_delete_file_from_directory()Deletes a file if its path is within the given directory.
- wp_mkdir_p()Recursive directory creation based on full path.
- wp_normalize_path()Normalizes a filesystem path.
Source
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 );}History
Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.