WordPress.org

Ready to get started?Download WordPress

Forums

Pinterest "Pin It" Button
[resolved] Poor use of the_content filter (3 posts)

  1. JakePT
    Member
    Posted 11 months ago #

    Hi,

    I'm running into an issue where this plugin is adding buttons to things it shouldn't. I have a couple of widgets that use the the_content filter, which causes this button to appear in annoying places.

    Doing some research it looks like the plugin is not being discerning enough when it comes to modifying the filter.

    See this post which mentions the issue:
    http://pippinsplugins.com/playing-nice-with-the-content-filter/

    Looks pretty good right? Actually no, there is still a major problem with this code. The thing that you must understand and acknowledge is that the “the_content” filter may NOT only get applied when we call the_content(). Often times plugin and theme developers will use something like the following to help format their custom queries:
    echo apply_filters('the_content', $custom_content_here);
    Doing this will pass whatever content is stored in the $custom_content_here variable and perform all of the nice formatting that we expect with the the_content() function. This also means that our pippin_filter_content_sample() function will attach its custom content to this other text as well, and that’s not good.

    A fix for this issue would be much appreciated.

    Cheers,
    Jacob

    http://wordpress.org/plugins/pinterest-pin-it-button/

  2. Phil Derksen
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Jacob,

    Thanks for pointing this out. Good timing as we're in the middle of re-writing a lot of the base code for the plugin. I trust just about all of Pippin's stuff so I'm pretty sure this will make it's way in. Look for it in the next update.

    Thanks,
    Phil

  3. JakePT
    Member
    Posted 11 months ago #

    Thanks, that's great to hear. Looking forward to it.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.