WordPress / wporg-mu-plugins

Development of the Global Header and other mu-plugins used on WordPress.org.
63 stars 29 forks source link

Add a shortcode for nocookie youtube embeds #651

Closed ryelle closed 2 months ago

ryelle commented 2 months ago

See https://github.com/WordPress/wporg-main-2022/issues/493#issuecomment-2316230298 — We'd like to use the "privacy-enhanced" youtube embeds, but the domain used is not supported by the core embeds. I've put this code in wporg-mu-plugins because I'll also want to use it on WCUS's livestream pages; and I can see needing it on other pages.

Hopefully the core ticket will be fixed at some point, and we can phase this out.

[youtube-nocookie title="Showcase Day video player"]https://www.youtube-nocookie.com/embed/PM2Ov8atqBw?si=4YwCx25TQfdWPcW_[/youtube-nocookie]
Screenshot 2024-09-10 at 6 34 43 PM

To test

Screenshot 2024-09-10 at 6 32 06 PM

Try other URLs, it should only create the iframe for youtube-nocookie.com domains.

ryelle commented 2 months ago

Going to merge this so I can build out the WordCamp pages, but we can iterate if needed.