Opened 11 years ago
Closed 10 years ago
#24381 closed enhancement (fixed)
A little more abstraction in the WP_oEmbed class
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
The logic for determining the oEmbed provider for a given URL is contained within the get_html()
method of the WP_oEmbed
class.
I'd like to be able to determine whether or not a given URL has a supported oEmbed provider. There's no method in the WP_oEmbed
class to do this, and I've copied the logic from get_html()
into my own function.
Patch coming up shortly.
Attachments (2)
Change History (7)
#2
@
11 years ago
- Keywords needs-docs added
Abstracting this seems logical, though I'm surprised we currently do a return false followed a filterable return.
I guess an argument can be made that the "oembed_result" filter should apply if there's actually a result though.
Also, might as well add hook docs while we're in there.
#3
@
11 years ago
- Keywords needs-docs removed
- Milestone changed from Awaiting Review to Future Release
24381.2.patch refreshes the patch to take into account the hook docs that have since been added. Also adds the new get_provider()
method above get_html()
so the diff is clearer.
24381.patch simply moves the logic for determining the provider for a URL into a new method,
get_provider()
.