Make WordPress Core

Opened 11 months ago

Last modified 10 months ago

#24456 new defect (bug)

Add src attribute to embed shortcode

Reported by: aaroncampbell Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Embeds Keywords: needs-patch
Focuses: Cc:


The embed shortcode takes URL as its content, but a/v ones take an attribute — make both for both?

See: http://make.wordpress.org/core/2013/05/29/post-formats-ui-is-exiting-core-will-live-as-a-plugin/

Attachments (2)

24456.diff (1.6 KB) - added by kovshenin 11 months ago.
24456.2.diff (398 bytes) - added by aaroncampbell 10 months ago.

Download all attachments as: .zip

Change History (8)

comment:2 wonderboymusic11 months ago

one caveat here - for video, if you want to add subtitles (which we don't support yet - MediaElement does), the body of the shortcode might be a good place to put it:

<track kind="subtitles" src="subtitles.srt" srclang="en" />

Otherwise, HTML frags will have to be passed to the shortcode as attributes. Granted, one could filter 'wp_mediaelement_fallback', but that sounds super ghetto

kovshenin11 months ago

comment:3 kovshenin11 months ago

24456.diff adds support for URL as the shortcode content for audio and video callbacks, as well as a src attribute to the embed shortcode callback. The src attribute (if not empty) has a higher priority in all three shortcodes.

Last edited 11 months ago by kovshenin (previous) (diff)

comment:4 wonderboymusic10 months ago

I am going to suggest not doing this - see my above comment about <video>, which can contain <track> in its body

comment:5 nacin10 months ago

  • Component changed from Media to Embeds
  • Milestone changed from 3.6 to Future Release
  • Summary changed from Make audio/video shortcodes consistent with embed to Add src attribute to embed shortcode

I agree with wonderboymusic, so does MarkJaquith per IRC.

In that case, maybe we can add 'src' to [embed].

Punting out of 3.6 as it's not a necessity.

aaroncampbell10 months ago

comment:6 aaroncampbell10 months ago

24456.2.diff is just an update to the patch by kovshenin with only the src attribute for embed part

Note: See TracTickets for help on using tickets.