Make WordPress Core

Changeset 29223


Ignore:
Timestamp:
07/18/2014 06:14:09 PM (11 years ago)
Author:
johnbillion
Message:

Update some inline docs for the WP_Http class. Fixes #28943.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r29107 r29223  
    6161     * @since 2.7.0
    6262     *
    63      * @param string $url URI resource.
    64      * @param str|array $args Optional. Override the defaults.
    65      * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
     63     * @param string $url The request URL.
     64     * @param string|array $args Optional. Override the defaults.
     65     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    6666     */
    6767    public function request( $url, $args = array() ) {
     
    140140         *
    141141         * @param array  $r   An array of HTTP request arguments.
    142          * @param string $url The request URI resource.
     142         * @param string $url The request URL.
    143143         */
    144144        $r = apply_filters( 'http_request_args', $r, $url );
     
    158158         * @param bool   $preempt Whether to preempt an HTTP request return. Default false.
    159159         * @param array  $r       HTTP request arguments.
    160          * @param string $url     The request URI resource.
     160         * @param string $url     The request URL.
    161161         */
    162162        $pre = apply_filters( 'pre_http_request', false, $r, $url );
     
    322322     * @param string $url URL to Request
    323323     * @param array $args Request arguments
    324      * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
     324     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    325325     */
    326326    private function _dispatch_request( $url, $args ) {
     
    342342         * @since 2.8.0
    343343         *
    344          * @param mixed  $response HTTP Response or WP_Error object.
    345          * @param string $context  Context under which the hook is fired.
    346          * @param string $class    HTTP transport used.
     344         * @param array|WP_Error $response HTTP response or WP_Error object.
     345         * @param string         $context  Context under which the hook is fired.
     346         * @param string         $class    HTTP transport used.
     347         * @param array          $args     HTTP request arguments.
     348         * @param string         $url      The request URL.
     349         */
     350        do_action( 'http_api_debug', $response, 'response', $class, $args, $url );
     351
     352        if ( is_wp_error( $response ) )
     353            return $response;
     354
     355        /**
     356         * Filter the HTTP API response immediately before the response is returned.
     357         *
     358         * @since 2.9.0
     359         *
     360         * @param array  $response HTTP response.
    347361         * @param array  $args     HTTP request arguments.
    348362         * @param string $url      The request URL.
    349363         */
    350         do_action( 'http_api_debug', $response, 'response', $class, $args, $url );
    351 
    352         if ( is_wp_error( $response ) )
    353             return $response;
    354 
    355         /**
    356          * Filter the HTTP API response immediately before the response is returned.
    357          *
    358          * @since 2.9.0
    359          *
    360          * @param array|obj $response HTTP Response.
    361          * @param array     $args     HTTP request arguments.
    362          * @param string    $url      The request URL.
    363          */
    364364        return apply_filters( 'http_response', $response, $args, $url );
    365365    }
     
    373373     * @since 2.7.0
    374374     *
    375      * @param string       $url  URI resource.
     375     * @param string       $url  The request URL.
    376376     * @param string|array $args Optional. Override the defaults.
    377      * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
     377     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    378378     */
    379379    public function post($url, $args = array()) {
     
    391391     * @since 2.7.0
    392392     *
    393      * @param string $url URI resource.
    394      * @param str|array $args Optional. Override the defaults.
    395      * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
     393     * @param string $url The request URL.
     394     * @param string|array $args Optional. Override the defaults.
     395     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    396396     */
    397397    public function get($url, $args = array()) {
     
    409409     * @since 2.7.0
    410410     *
    411      * @param string $url URI resource.
    412      * @param str|array $args Optional. Override the defaults.
    413      * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
     411     * @param string $url The request URL.
     412     * @param string|array $args Optional. Override the defaults.
     413     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    414414     */
    415415    public function head($url, $args = array()) {
     
    784784     *
    785785     * @access public
    786      * @param string $url URI resource.
     786     * @param string $url The request URL.
    787787     * @param string|array $args Optional. Override the defaults.
    788      * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
     788     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    789789     */
    790790    public function request($url, $args = array()) {
     
    12191219     * @since 2.7.0
    12201220     *
    1221      * @param string $url
    1222      * @param str|array $args Optional. Override the defaults.
    1223      * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
     1221     * @param string $url The request URL.
     1222     * @param string|array $args Optional. Override the defaults.
     1223     * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    12241224     */
    12251225    public function request($url, $args = array()) {
     
    13561356         * @param resource &$handle The cURL handle returned by curl_init().
    13571357         * @param array    $r       The HTTP request arguments.
    1358          * @param string   $url     The destination URL.
     1358         * @param string   $url     The request URL.
    13591359         */
    13601360        do_action_ref_array( 'http_api_curl', array( &$handle, $r, $url ) );
Note: See TracChangeset for help on using the changeset viewer.