Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#24381 closed enhancement (fixed)

A little more abstraction in the WP_oEmbed class

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.9
Component: Embeds Keywords: has-patch
Focuses: Cc:


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)

24381.patch (1.6 KB) - added by johnbillion 11 years ago.
24381.2.patch (1.9 KB) - added by johnbillion 10 years ago.

Download all attachments as: .zip

Change History (7)

11 years ago

#1 @johnbillion
11 years ago

  • Keywords has-patch added

24381.patch simply moves the logic for determining the provider for a URL into a new method, get_provider().

#2 @DrewAPicture
10 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 @johnbillion
10 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.

#4 @wonderboymusic
10 years ago

  • Milestone changed from Future Release to 4.0
  • Owner set to johnbillion
  • Status changed from new to reviewing

Drop this in if you still want it

#5 @johnbillion
10 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 28728:

A little more abstraction in the WP_oEmbed class. Fixes #24381.

Note: See TracTickets for help on using tickets.