WordPress.org

Ready to get started?Download WordPress

Forums

WP-Ajaxify-Comments
[resolved] Youtube Embed Code gets stripped off if page is not manually refreshed (10 posts)

  1. tanqeed
    Member
    Posted 1 year ago #

    If I add youtube embed code the video shows up fine on the first comment. But if I add another youtube embed code without manually refreshing the page the embed code gets stripped off in the second/third and all successive comments. Once I manually refresh the page and add a youtube embed code the video shows up again.

    http://wordpress.org/extend/plugins/wp-ajaxify-comments/

  2. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your comment. Could you please provide more details about how you embed the YouTube video? Do you use any WordPress plugin or is the html embed code part of the comment?

  3. tanqeed
    Member
    Posted 1 year ago #

    I am just using the iframe embed code from the youtube video. I am not using any plugin for displaying youtube videos.

    You can see it here in action. The first comment displays the video while the 2nd/3rd comments the embed code was stripped off and there is no video displayed. I used embed code of other videos - they are not all the same videos.

    I then manually refreshed the page and made a comment with the embed code along with the word "test" and it showed up fine. I then made a comment with another embed code and "test again" and only test again shows up and embed code is stripped off.

    http://tanqeed.com/hollywood/passion-official-trailer/

  4. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    as far as I know by default <iframe> tags are not allowed in comments. Have installed any other plugin that enables the <iframe> tags or is the "<iframe>-tag-support" part of your theme?

  5. tanqeed
    Member
    Posted 1 year ago #

    I have a plugin User Role Editor using which I allow Unfiltered html for people with role of Authors.

  6. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for your reply. I've tried the "User Role Editor" plugin and added the role "unfiltered_html" to my users but still no luck when posting <iframe> tags. Which WordPress version are you using?

    I was only able to post <iframe> tags when editing wp-includes\kses.php similar to the description here http://www.kavdesign.net/blog/coding/how-to-disable-wordpress-html-filter-for-posts-and-pages/.

    After commenting out the following lines:

    // Comment filtering
    if ( current_user_can( 'unfiltered_html' ) )
      add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
    else
      add_filter( 'pre_comment_content', 'wp_filter_kses' );

    posting <iframe> tags was possible but I did not find any conflicts with the WP-Ajaxify-Comments plugin. I think your problems are not caused by my plugin. Please make sure that the <iframe> tags inside the comments are really saved in the database and are returned to the theme when rendering the comment section.

    Hope this helps...

  7. tanqeed
    Member
    Posted 1 year ago #

    I am using WordPress 3.5.1 and its a child theme of TwentyTen.

    I disabled WP-Ajaxify-Comments plugin and am able to post iframe code one after the other. There's something with the refreshing of the whole page. If the whole page is refreshed then the embed shows up fine even when using your plugin.

    Thanks for that filter info.

  8. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, could you please send me login credentials for your page that enables me to post comments with <iframe>-tags? You can send me a private message here: http://blog.janjonas.net/contact

    Thanks...

  9. tanqeed
    Member
    Posted 1 year ago #

    Sent you a private message. Thanks.

  10. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Mark this topic as resolved ...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.