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]
To test
Find a youtube video
Click share, embed to get to the iframe code
Select "Enable privacy-enhanced mode."
From there, copy out the src URL
Create or edit a post, add the shortcode block
Add the shortcode: [youtube-nocookie]COPIED URL[/youtube-nocookie]
Optionally set height, width, and title attributes
Try other URLs, it should only create the iframe for youtube-nocookie.com domains.
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.
To test
src
URL[youtube-nocookie]COPIED URL[/youtube-nocookie]
Try other URLs, it should only create the iframe for youtube-nocookie.com domains.