[wp-trac] [WordPress Trac] #38205: Lack of actions/filters to access Requests library hooks

WordPress Trac noreply at wordpress.org
Sat Oct 1 15:35:43 UTC 2016


#38205: Lack of actions/filters to access Requests library hooks
--------------------------+-----------------------------
 Reporter:  reidbusi      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  HTTP API      |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I am unable to register hooks to the Requests library in the WordPress
 4.6.x HTTP API context.

 I refer you to: https://github.com/rmccue/Requests/issues/233 ( see later
 comments where I realise that Requests hooks must be passed to Requests
 functions when called )

 WP 4.6.1 wp-includes\class-http.php line 303:
 {{{#!php
                 $options = array(
                         'timeout' => $r['timeout'],
                         'useragent' => $r['user-agent'],
                         'blocking' => $r['blocking'],
                         'hooks' => new Requests_Hooks(),
                 );
 }}}

 Not quite sure what the right fix here is. Possibly naming the
 Requests_Hooks object and providing an action where it can be modified? I
 will test such a modification of the core and post my results here...

 ''(It is worth noting here that the relatively new WooCommerce Square
 extension has recently abandoned the WP HTTP API and is manually building
 and executing PHP cURL requests, presumably due to this new inadequacy of
 WP's HTTP API)''

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38205>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list