Poor use of the_content filter
-
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:
https://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
- The topic ‘Poor use of the_content filter’ is closed to new replies.