Opened 12 years ago
Closed 11 years ago
#23442 closed enhancement (fixed)
Allow wp_remote_get args to be filtered for oEmbed calls
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently, the oEmbed code use wp_remote_get() to communicate with the oEmbedded service. However, there's no way to filter the arguments that get used - it simply uses the system wide defaults.
Filtering the defaults (E.g. http_request_timeout) seems overkill when you know that you only want to change things for something specific like an oEmbed call that you know may take longer than 5 seconds (E.g.
https://github.com/leewillis77/wp-github-oembed/blob/1.2/github-api.php#L35)
The attached patch adds a new filter oembed_remote_get_args which allows plugins to override the wp_remote_get args for oembed calls (Including discovery)
Attachments (3)
Change History (8)
#2
@
11 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from Awaiting Review to Future Release
These filters will need documentation. They could probably benefit from additional context, such as the URL being passed and anything else available to it. Looks good, otherwise.
#4
@
11 years ago
- Keywords has-patch added; needs-patch needs-docs removed
- Milestone changed from Future Release to 4.0
23442.2.diff adds filter docs, passing $url
per comment:2.
My only real concern there is that $provider_url_with_args
passed to the duplicate filter evaluation would differ in form from $url
. I suppose we could pass a context string.
Patch