New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Youtube shortcode stopped working after upgrading to WordPress 4.4 #3121
Comments
Caused by https://core.trac.wordpress.org/changeset/34747 per Looks like Core no longer trips on the |
I can't tell if 34747's breaking of the format was intentional or not per the Shortcode Roadmap. Opened https://core.trac.wordpress.org/ticket/34939 to get a clarification/report it. |
Hello, I can't see any video from my blog. I only see de the shortcode for example [youtube=https://youtu.be/IGrqiSYc1oM&w=600&h=440] in my post http://postresoriginales.com/pastel-de-naranja/ and i have more than 200 pages with this shortcode for YouTube Also I inserted your code [youtube=https://www.youtube.com/watch?v=zbn5_3yf6VQ&w=660] and i don't see anything Thanks |
Hi @pilarmonge80 - your issue is the one being discussed in this ticket. WordPress 4.4 stopped processing shortcodes built like that (e.g. For an immediate fix, you can update to |
Thanks @kraftbj I'll wait because I find myself unable to make that change :) |
While https://core.trac.wordpress.org/ticket/34939 is still in play, we should start preparing a PR to do an early filter on Also noting the en.support docs need to be updated as they have this format all over the place. :) |
Do you happen to know yet whether the Youtube shortcode will be reinstated in the same form -- and when? Likewise I have used it a great number of times on my website, and should very much prefer to avoid having to change all that code. |
@Musicuratum - Details will be posted here as they're known. Long-term, it is probably best to not use this format (rather Per my comment above, we'll likely have a shim to convert, on display, the |
Of course I won't be using that shortcode again -- unless it's simply reinstated. For all the instances when I have used it, however, I'm waiting eagerly for your solution. All the more as it was the official Jetpack shortcode and as such abandoned without notice. (Given that I modify several of the parameters, embedding YT works best, I've found, with a shortcode, as opposed to simply including the URL on its own line.) |
@Musicuratum - It wasn't abandoned, as much as an unintended change upstream by WordPress led to it no longer being seen as a shortcode. We'll figure out something so you're not stuck. But, in any case, I would suggest using |
For the moment I don't have any YT materials to embed, fortunately. Yes, when I do, I'll use that other shortcode. Do you happen to know when the documentation concerning it and its various possible parameters will be written? |
It's the same shortcode. Same exact behavior. https://en.support.wordpress.com/videos/youtube/ |
Very well, I see that that page has been updated -- earlier it provided the shortcode I've been using. Please do let me know when the solution for dealing with the now deprecated one is ready. |
Thank you for being looking for a solution because I do not feel able to enter the code to put the patch :) |
I assume it's known that this goes beyond just YouTube shortcode. I use the popular Starter theme in various places, and it's shortcode functions are also broken with 4.4. |
@darrenbrett - For the broader conversation, see https://core.trac.wordpress.org/changeset/34747 . This format is non-standard, though, so we're going to work toward not using them here on out. |
Sorry @kraftbj but I do not hear . If you have already prepared a patch why not directly upload that file to modify it with FILEZILLA . |
@pilarmonge80 The patch is available here: If you don't feel comfortable editing PHP files yourself, I'd suggest joining Jetpack's Beta group and installing the Beta plugin. You will then get to test the patch as soon as we release a Beta for the next version of Jetpack, 3.8.2. It should happen in the next few days. |
thanks @jeherve I've change the two files functions.compat.php and modules/shortcodes/youtube.php but now i don't see the videos again. Have I change more codes?? |
@pilarmonge80 on the front-end of your site, are you seeing the shortcode text or nothing at all? Could you please paste the exact shortcode you're using? Thanks! |
Hello @dereksmart I have this type of code in more than 200 pages in my blog |
@pilarmonge80 Could you try the following:
Let us know how it goes. |
It's worth noting that the link to https://youtu.be/IGrqiSYc1oM&w=600&h=440 is a 404, which is probably why it's not showing. I tested it in WordPress 4.3.1 and no luck there either. |
When I remove the width and height arguments, it works ok |
I don't think the youtu.be urls work with parameters. When I use [youtube=https://www.youtube.com/watch?v=IGrqiSYc1oM&w=600&h=440] it works ok |
@jeherve I've done the three steps and go on whatching only the code like [youtube=https://youtu.be/IGrqiSYc1oM&w=600&h=440] @dereksmart I wrote the shortcode for whatching the video. The last parameters are the width and height. Before the update of wordpress i could see the vide like this For whatching now the videos I have to add in the shortcode [youtube url=https://youtu.be/IGrqiSYc1oM&w=600&h=440] but the problem is that i have more than 200 pages. Regards |
thanks @pilarmonge80 working up a patch to look for the shortened youtu.be urls |
thanks @dereksmart so i have to wait and i don't to change anything, don't I?? |
yep we will have a patch ready today! |
Great!!! @dereksmart thanks a lot for being working so much :D |
Just to clarify, will the patch cover the shortcodes issue in general, or just the YouTube issue specifically? |
@darrenbrett I believe our youtube shortcode is the only one that we use the |
@pilarmonge80. If you update to the most recent version of this this patch it should work ok now. this line is what changed from the last patch: |
Thank you very much @dereksmart and @jeherve I've change the line $content = preg_replace( '@[youtube=(.*?youtu(be)?.(com|be).+?)]@', '[youtube $1]', $content ); and now everything is ok :) Have a nice weekend |
you as well, thanks for testing :) |
So just to clarify, re: the issues discussed here: https://core.trac.wordpress.org/changeset/34747, will it be up to individual people to update the PHP - or will there be some patching made available via WordPress at some point? Just trying to understand this in terms of the commitment to backwards compatibility as well. Thanks. |
I can't speak for the core team ATM, but afaik they have no plans to rollback that change and it will be up to theme/plugin devs to update their products to adhere to this change. https://core.trac.wordpress.org/ticket/34939 would be a good place to ask / follow for more info. |
Okay, thanks. |
If it helps, I successfully changed 1,786 instances of [youtube= ...] to [youtube url= ...] on posts going back over 6 years, using the excellent "Search Regex" plugin - and it only took a few seconds. |
Several reports in the forums:
https://wordpress.org/support/topic/youtube-shortcode-no-longer-working-after-updating-to-44?replies=10#post-7755539
https://wordpress.org/support/topic/youtube-shortcode-stopped-working-with-wp-44?replies=5
I confirmed with this shortcode:
[youtube=https://www.youtube.com/watch?v=zbn5_3yf6VQ&w=660]
The text was updated successfully, but these errors were encountered: