requests-<hook>
Transforms a native Request hook to a WordPress actions.
Description
This action maps Requests
internal hook to a native WordPress action.
Parameters (3)
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'requests-{$hook}', $parameters, $this_request, $this_url );
- The following example is for adding a hook callback.
- // define the requests-<hook> callback
- function action_requests_hook( $parameters, $this_request, $this_url ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "requests-{$hook}", 'action_requests_hook', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action_ref_array( "requests-{$hook}", $parameters, $this->request, $this->url );