WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 2 months ago

#23442 new enhancement

Allow wp_remote_get args to be filtered for oEmbed calls

Reported by: leewillis77 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.5
Component: Embeds Keywords: needs-patch needs-docs
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 (2)

23442-1.diff (1.1 KB) - added by leewillis77 15 months ago.
Patch
23442.diff (1.0 KB) - added by leewillis77 5 months ago.
The previous patch didn't apply against current trunk, updated patch attached

Download all attachments as: .zip

Change History (5)

leewillis7715 months ago

Patch

comment:1 SergeyBiryukov14 months ago

  • Version changed from trunk to 3.5

leewillis775 months ago

The previous patch didn't apply against current trunk, updated patch attached

comment:2 nacin2 months 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.

comment:3 DrewAPicture2 months ago

  • Keywords needs-docs added
Note: See TracTickets for help on using tickets.