WordPress.org

Ready to get started?Download WordPress

Forums

Polldaddy Polls & Ratings
[resolved] WordPress is altering HTML output of Polldaddy plugin. (2 posts)

  1. jrhall
    Member
    Posted 2 years ago #

    I'm having some trouble with WP "correcting" code for the Polldaddy plugin. Here's the original code from polldaddy/ratings.php:

    http://pastebin.com/pvEST4cm

    Here's what WP is kicking out:

    http://pastebin.com/TJZvPdPN

    I'm noticing two "errors":

    1. <p> tag being added at the beginning of line 2.
    2. The second > is being converted to >.

    I'm using this plugin, which should be disabling wpautop, etc. It's odd, too, that it's only converting one >. As far as I know, the plugin is working, as my post and page content is not affected.

    I basically never use the WYSIWYG editor, and I have tried deleting and creating new posts, etc., but still no luck. Any help would be appreciated. All of my pages validate XHTML 1.0 STRICT, but anything with a post on it (because of ratings) fails to validate. If I turn off ratings for posts, the post page validates. (FYI: I don't use ratings on pages)

    I will try to check back frequently if anyone has an idea but needs more information. Thanks!

    http://wordpress.org/extend/plugins/polldaddy/

  2. jrhall
    Member
    Posted 2 years ago #

    First, I just noticed that the content in my earlier post isn't quite correct. The issue is that WordPress is changing any instance of ]]> to ]]& g t ; (I've inserted the spaces because I don't know how else to force the HTML reference to display without converting to the >. While that works great for displaying text on a page, it's definitely not the same thing when the browser goes to interpret HTML code.

    I found a solution, though it's less than desirable.

    Unfortunately, the only way I can find to stop WordPress from mangling the Polldaddy ratings code is to alter a WordPress core file. I've tried unloading every filter, and the issue still persists. The "solution" is this:

    Modify file: /wp-includes/post-template.php

    Original:
    Line 168: $content = str_replace(']]>', ']]&gt', $content);

    Modified:
    Line 168: //$content = str_replace(']]>', ']]&gt', $content);

    Again, this isn't really an ideal solution since you have to modify the WordPress core, but it's the only half-way solution I've found so far.

    I'll mark this thread resolved, but it'd be nice if there were a better solution...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags