requests-<hook>

Transforms a native Request hook to a WordPress actions.

Description

do_action( 'requests-<hook>', (array) $parameters, (array) $this_request, (string) $this_url ); 

This action maps Requests internal hook to a native WordPress action.

Parameters (3)

0. $parameters (array)
Parameters from Requests internal hook.
1. $this_request (array)
Request data in WP_Http format.
2. $this_url (string)
URL to request.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'requests-{$hook}', $parameters, $this_request, $this_url ); 
The following example is for adding a hook callback.
  1. // define the requests-<hook> callback 
  2. function action_requests_hook( $parameters, $this_request, $this_url ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "requests-{$hook}", 'action_requests_hook', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "requests-{$hook}", 'action_requests_hook', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/class-wp-http-requests-hooks.php  
  1. do_action_ref_array( "requests-{$hook}", $parameters, $this->request, $this->url );