Make WordPress Core

Changeset 32599


Ignore:
Timestamp:
05/25/2015 05:31:02 PM (9 years ago)
Author:
wonderboymusic
Message:

Cleanup doc blocks in http.php.
In the few functions that used $objFetchSite instead of $http: use the $http naming, which is more civilized.

See #32444.

File:
1 edited

Legend:

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

    r30674 r32599  
    1717 * @since 2.7.0
    1818 * @access private
     19 *
     20 * @staticvar WP_Http $http
    1921 *
    2022 * @return WP_Http HTTP Transport object.
     
    150152 */
    151153function wp_remote_request($url, $args = array()) {
    152     $objFetchSite = _wp_http_get_object();
    153     return $objFetchSite->request($url, $args);
     154    $http = _wp_http_get_object();
     155    return $http->request( $url, $args );
    154156}
    155157
     
    167169 */
    168170function wp_remote_get($url, $args = array()) {
    169     $objFetchSite = _wp_http_get_object();
    170     return $objFetchSite->get($url, $args);
     171    $http = _wp_http_get_object();
     172    return $http->get( $url, $args );
    171173}
    172174
     
    184186 */
    185187function wp_remote_post($url, $args = array()) {
    186     $objFetchSite = _wp_http_get_object();
    187     return $objFetchSite->post($url, $args);
     188    $http = _wp_http_get_object();
     189    return $http->post( $url, $args );
    188190}
    189191
     
    201203 */
    202204function wp_remote_head($url, $args = array()) {
    203     $objFetchSite = _wp_http_get_object();
    204     return $objFetchSite->head($url, $args);
     205    $http = _wp_http_get_object();
     206    return $http->head( $url, $args );
    205207}
    206208
     
    225227 * @since 2.7.0
    226228 *
    227  * @param array $response
     229 * @param array  $response
    228230 * @param string $header Header name to retrieve value from.
    229231 * @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
     
    294296 *
    295297 * @param array  $capabilities Array of capabilities to test or a wp_remote_request() $args array.
    296  * @param string $url Optional. If given, will check if the URL requires SSL and adds that requirement to the capabilities array.
     298 * @param string $url          Optional. If given, will check if the URL requires SSL and adds
     299 *                             that requirement to the capabilities array.
    297300 *
    298301 * @return bool
    299302 */
    300303function wp_http_supports( $capabilities = array(), $url = null ) {
    301     $objFetchSite = _wp_http_get_object();
     304    $http = _wp_http_get_object();
    302305
    303306    $capabilities = wp_parse_args( $capabilities );
     
    317320    }
    318321
    319     return (bool) $objFetchSite->_get_first_available_transport( $capabilities );
     322    return (bool) $http->_get_first_available_transport( $capabilities );
    320323}
    321324
     
    383386 *
    384387 * @param null|string $origin Origin URL. If not provided, the value of get_http_origin() is used.
    385  * @return bool|null True if the origin is allowed. False otherwise.
     388 * @return string True if the origin is allowed. False otherwise.
    386389 */
    387390function is_allowed_http_origin( $origin = null ) {
     
    399402     * @since 3.4.0
    400403     *
    401      * @param string $origin Result of check for allowed origin.
    402      * @param string $origin_arg original origin string passed into is_allowed_http_origin function.
     404     * @param string $origin     Result of check for allowed origin.
     405     * @param string $origin_arg Original origin string passed into is_allowed_http_origin function.
    403406     */
    404407    return apply_filters( 'allowed_http_origin', $origin, $origin_arg );
     
    415418 * @since 3.4.0
    416419 *
    417  * @return bool|string Returns the origin URL if headers are sent. Returns false
    418  * if headers are not sent.
     420 * @return string|false Returns the origin URL if headers are sent. Returns false
     421 *                      if headers are not sent.
    419422 */
    420423function send_origin_headers() {
     
    488491                 * @since 3.6.0
    489492                 *
    490                  * @param bool false Whether HTTP request is external or not.
     493                 * @param bool   false Whether HTTP request is external or not.
    491494                 * @param string $host IP of the requested host.
    492                  * @param string $url URL of the requested host.
     495                 * @param string $url  URL of the requested host.
    493496                 */
    494497                if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) )
     
    518521 * @since 3.6.0
    519522 *
    520  * @param bool $is_external
     523 * @param bool   $is_external
    521524 * @param string $host
    522525 * @return bool
     
    535538 * @since 3.6.0
    536539 *
    537  * @param bool $is_external
     540 * @global wpdb $wpdb
     541 * @staticvar array $queried
     542 *
     543 * @param bool   $is_external
    538544 * @param string $host
    539545 * @return bool
Note: See TracChangeset for help on using the changeset viewer.