Closed montchr closed 8 years ago
Huh. Can you share the full shortcode?
There isn't any functional difference between the frontend and the backend: https://github.com/wp-shortcake/shortcake-bakery/blob/master/inc/shortcodes/class-youtube.php#L46-L75
[youtube url="https://www.youtube.com/watch?v=f9y9Snt1g5E&list=PL6F6DE2FF0854D7C6"]
Hm. The shortcode you provided works as expected for me locally.
Are you running Jetpack? Or do you have other plugins which could be interfering?
I just tested on a fresh install and the issue is still happening. Fresh clones of the Shortcake and Shortcake Bakery repos too.
Ok. I was able to reproduce. The problem seems to be specific to previewing a post.
When the shortcode is rendered during a preview, the passed URL is:
https://www.youtube.com/watch?v=f9y9Snt1g5E&list=PL6F6DE2FF0854D7C6
When the shortcode is rendered after the post is saved and the permalink is accessed, the passed URL is:
https://www.youtube.com/watch?v=f9y9Snt1g5E&list=PL6F6DE2FF0854D7C6
parse_url()
doesn't properly handle the #038;
encoded version of the ampersand. However, I'm not sure why it's being encoded this way.
:hammer:
If I add a YouTube video with a playlist ID in the URL, the shortcode text includes the full URL I supplied it, and the in-editor rendering of the
<iframe>
uses this URL and the resulting embed indicates that the video is in a playlist:However, when I view the post on the frontend, the URL for the
<iframe>
does not include the playlist ID, and the embed treats the video as a single video: