Make WordPress Core

Ticket #33995: 33995.patch

File 33995.patch, 1.5 KB (added by johnbillion, 10 years ago)
  • src/wp-includes/class-http.php

     
    159159                        $r['_redirection'] = $r['redirection'];
    160160
    161161                /**
    162                  * Filter whether to preempt an HTTP request's return.
     162                 * Filter whether to preempt an HTTP request's return value.
    163163                 *
    164                  * Returning a truthy value to the filter will short-circuit
    165                  * the HTTP request and return early with that value.
     164                 * Returning a non-false value from the filter will short-circuit the HTTP request and return early with
     165                 * that value. A filter should return either:
     166                 *
     167                 *  - An array containing 'headers', 'body', 'response', 'cookies', and 'filename' elements
     168                 *  - A `WP_Error` instance
     169                 *  - boolean false (to avoid short-circuiting the response)
     170                 *
     171                 * Returning any other value may result in unexpected behaviour.
    166172                 *
    167173                 * @since 2.9.0
    168174                 *
    169                  * @param bool   $preempt Whether to preempt an HTTP request return. Default false.
    170                  * @param array  $r       HTTP request arguments.
    171                  * @param string $url     The request URL.
     175                 * @param bool|array|WP_Error $preempt Whether to preempt an HTTP request's return value. Default false.
     176                 * @param array               $r       HTTP request arguments.
     177                 * @param string              $url     The request URL.
    172178                 */
    173179                $pre = apply_filters( 'pre_http_request', false, $r, $url );
    174180                if ( false !== $pre )