use_streams_transport
Filters whether streams can be used as a transport for retrieving a URL.
Description
Parameters (2)
- 0. $true (bool) =>
true
- Whether the class can be used. Default true.
- 1. $args (array)
- Request arguments.
Usage
- To run the hook, copy the example below.
- $true = apply_filters( 'use_streams_transport', $true, $args );
- if ( !empty( $true ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the use_streams_transport callback
- function filter_use_streams_transport( $true, $args ) {
- // make filter magic happen here...
- return $true;
- };
- // add the filter
- add_filter( 'use_streams_transport', 'filter_use_streams_transport', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'use_streams_transport', 'filter_use_streams_transport', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/class-wp-http-streams.php
- return apply_filters( 'use_streams_transport', true, $args );