WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28125 closed enhancement (fixed)

youtube oembed for playlist link

Reported by: alexufo Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9
Component: Embeds Keywords:
Focuses: Cc:

Description

i think better add youtube playlist for auto embeding.
http://www.youtube.com/playlist?list=PL6BCB25412319E08A

This code must add to class-oembed.php providers. I think playlist id lenth is 18.

'#http:\/\/(www\.)?youtube\.com\/playlist\?list=.{18}#i'    => array( 'http://www.youtube.com/oembed', true  ),

and... why "/" are not escaping in class-oembed.php providers?

Change History (8)

#1 @wonderboymusic
7 years ago

  • Milestone changed from Awaiting Review to 4.0

#2 @wonderboymusic
7 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 28552:

Support oEmbed matching for YouTube playlist URLs.

Fixes #28125.

#3 @SergeyBiryukov
7 years ago

and... why "/" are not escaping in class-oembed.php providers?

It only needs escaping if it's used as a delimiter in the same expression. We use # as a delimiter here.

#4 follow-up: @kovshenin
7 years ago

Has anybody considered, that every time we change the regex/pattern in any of the existing items in the oEmbed providers list, we're breaking backwards compatibility for sites that use wp_oembed_remove_provider(), for example to disallow YouTube embeds?

#5 @wonderboymusic
7 years ago

In 28593:

For YouTube playlist oEmbed, we need keep BC for wp_oembed_remove_provider() by not changing the existing YouTube endpoint keys. So, rather than merging the rules, the playlist endpoints should be on their own line.

Props kovshenin.

See #28125, [28552].

#6 in reply to: ↑ 4 @nacin
7 years ago

Replying to kovshenin:

Has anybody considered, that every time we change the regex/pattern in any of the existing items in the oEmbed providers list, we're breaking backwards compatibility for sites that use wp_oembed_remove_provider(), for example to disallow YouTube embeds?

I've not considered this. I'm OK with [28593] but I wouldn't consider this precedent-setting. We've changed patterns before and probably will have a need to in the future.

#7 follow-up: @kovshenin
7 years ago

Re r28593, I wasn't implying that every new variation/addition to an embed handler should be a regex of its own, that's actually worse, because the regex engine now has to parse, cache and execute four expressions instead of two. The reason I asked about backwards compatibility is whether perhaps we should be looking at keying the list by a unique handle instead of a regular expression.

#8 in reply to: ↑ 7 @Viper007Bond
7 years ago

Replying to kovshenin:

perhaps we should be looking at keying the list by a unique handle instead of a regular expression.

Sounds like a good idea to me. That's how the non-oEmbed callback embed handlers work.

Note: See TracTickets for help on using tickets.