Opened 15 years ago
Closed 15 years ago
#10413 closed enhancement (fixed)
Allow plugins to short -circuit WP_Http::request()
Reported by: | johnbillion | Owned by: | dd32 |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.1 |
Component: | HTTP API | Keywords: | has-patch tested |
Focuses: | Cc: |
Description
There is no way for plugins to add caching functionality to any of the HTTP functions (such as wp_remote_get()
) in WordPress.
An easy way to add this is to provide a short-circuit option just like that found in get_option()
where a plugin can hook into pre_option_{$option_name}
and return a value for that option.
A simple filter which passes the arguments array and the URL will do nicely.
Attachments (1)
Change History (6)
#2
@
15 years ago
Patch updated.
Of course, we also need a way for plugins to access the result of the HTTP request (and potentially cache it), so let's add a http_response
filter to the response.
Note: See
TracTickets for help on using
tickets.
Patch.
Adds a new filter called
pre_http_request
which passes the arguments array and the URL of the request.