http_api_debug
Fires after an HTTP API response is received and before the response is returned.
Description
Parameters (5)
- 0. $response (array|WP_Error)
- HTTP response or
WP_Error
object. - 1. $response (string) =>
'response'
- Context under which the hook is fired.
- 2. $requests (string) =>
'Requests'
- HTTP transport used.
- 3. $r (array)
- HTTP request arguments.
- 4. $url (string)
- The request URL.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'http_api_debug', $response, $response, $requests, $r, $url );
- The following example is for adding a hook callback.
- // define the http_api_debug callback
- function action_http_api_debug( $response, $response, $requests, $r, $url ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'http_api_debug', 'action_http_api_debug', 10, 5 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'http_api_debug', 'action_http_api_debug', 10, 5 );
Defined (2)
The action is defined in the following location(s).
- /wp-includes/class-http.php
- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
- do_action( 'http_api_debug', $response, 'response', $class, $args, $url );