WordPress.org

Ready to get started?Download WordPress

Forums

Testimonial Rotator
[resolved] Conflict with Ninja Forms (3 posts)

  1. kitchin
    Member
    Posted 7 months ago #

    see: http://wordpress.org/support/topic/duplicate-forms-shown-on-page-bug-with-slideshows
    I think the bug is in Ninja Forms, but I guess it could be a matter of opinion. The problem in many authors use the 'the_content' filter to add plugin content to pages, and it's hard to detect if the filter's being called from inside a widget or whatever (which is what Testimonial Rotator does). I think it's legit to filter excerpts with 'the_content', but if you want to be extra safe you can iterate through the default WP content filters and apply them directly, instead of using apply_filters('the_content',...).

    http://wordpress.org/plugins/testimonial-rotator/

  2. kitchin
    Member
    Posted 5 months ago #

    Fixed in Testimonial Rotator 3.4! Thanks!

    For those interested, Testimonial Rotator no longer applies "the_content" filters. Instead it calls "do_shortcodes" which comes down to a subset of "the_content" filters.
    was:
    apply_filters( 'the_content', get_the_content()
    now:
    do_shortcode(nl2br(get_the_content(' ')).

    This is great, no more problems with Ninja Forms. I still wonder what is the best way for plugins like that to use "the_content" for what is really serving special pages. I've done it myself in code. Maybe it's an OK way to do it, rather than getting into the query before the page is loaded. The technique is to add a "the_content" filter and look at post->ID to see if you want to serve up your special content. Seems simple until you notice other apply_filter's of "the_content". I think you're pretty safe with WP core itself.

  3. Hal Gatewood
    Member
    Plugin Author

    Posted 5 months ago #

    Yeah, I think plugin authors who attach into that filter need to do a good amount of filtering with is_single, is_archive, etc.

    Glad this fixed it for you. I was having more and more complaints about this one and just had to make the switch. Not sure when it will cause problems for others, but I think this is the best solution for now.

Reply

You must log in to post.

About this Plugin

About this Topic