wp_is_stream

Test if a given path is a stream URL.

Description

wp_is_stream( (string) $path ); 

Parameters (1)

0. $path (string)
The resource path or URL.

Usage

  1. if ( !function_exists( 'wp_is_stream' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // The resource path or URL. 
  5. $path = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_is_stream($path); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function wp_is_stream( $path ) { 
  2. $wrappers = stream_get_wrappers(); 
  3. $wrappers_re = '(' . join('|', $wrappers) . ')'; 
  4.  
  5. return preg_match( "!^$wrappers_re://!", $path ) === 1;