WordPress.org

Forums

[resolved] YouTube HTML codes not working with new update (8 posts)

  1. TonySantorsa
    Member
    Posted 2 years ago #

    Whenever I sent a post to autopublish with YouTube HTML codes, they just disappear as if they weren't there.

    Anyone else having this problem?

  2. tomontoast
    Member
    Posted 2 years ago #

    Does this only occur with autopublished posts? Have you tried to diagnose the cause of the problem? Which HTML code are you using?

  3. rfair404
    Member
    Posted 2 years ago #

    I can't say for sure until you post some more details about the particular code but I imagine that wpkses is stripping out the code.

    I worked on a site a long time ago that subscribed to multiple yt feeds and scraped their posts for the video urls.

    You could attempt to fix this one of two (or more possibly) ways:

    Method one, filter the accepted tags used with wpkses, whitelist the syntax used in the yt html, that it wp will stop stripping the html.

    Method two, hook a function before wpkses is run to strip out the html generated by yt, and strip out only the URL to the youtube video and insert only the link, so that WordPress's built in oembed method will work.

    Personally I prefer the second method as it is much cleaner, and easier.

  4. TonySantorsa
    Member
    Posted 2 years ago #

    It's only when I auto publish.

    This problem started happening with the new update of WordPress.

    I post YouTube videos daily and I use the embedded video from the video itself and just put it in the HTML part of the post. But that's now called "text" instead of HTML.

  5. tomontoast
    Member
    Posted 2 years ago #

    So you use
    <iframe width="560" height="315" src="http://www.youtube.com/embed/oUHiDe-LzVc" frameborder="0" allowfullscreen></iframe>

    If so try adding an arbitrary iframe eg

    <iframe src="http://www.google.co.uk"></iframe>

    and see if that works.

  6. TonySantorsa
    Member
    Posted 2 years ago #

    Why .uk?

  7. tomontoast
    Member
    Posted 2 years ago #

    I live in UK lol!

  8. tomontoast
    Member
    Posted 2 years ago #

    This problem is caused by a bug in WordPress 3.5. See http://core.trac.wordpress.org/ticket/22944

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.