WordPress.org

Forums

Testimonial Rotator
Possible Plugin Conflict (6 posts)

  1. tferry
    Member
    Posted 10 months ago #

    I have both the Testimonial Rotator and the Simple Staff List plugins running together and it looks like there is a possible conflict.

    In the Simple Staff List dashboard area I get the following error under the "Staff Bio" column for each entry:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'testimonial_rotator_single' not found or invalid function name in [...]/wp-includes/plugin.php on line 192

    This seems to be preventing me from using the 'Staff Bio' info elsewhere in the site.

    I thought it was an issue with the Simple Staff List plugin until I noticed the "function 'testimonial_rotator_single'" part. When I deactivate the Testimonial Rotator plugin the warning messages no longer appears.

    Would really appreciate any help fixing this issue.

    Thanks!

    Tommy

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

  2. kitchin
    Member
    Posted 10 months ago #

    Note to developer:
    add_filter( 'the_content', 'testimonial_rotator_single' );
    Note sure why you're putting this in a setup function, but it would be a good idea to use a wrapper that's always defined:

    add_filter( 'the_content', 'testimonial_rotator_single_wrapper' );
    
    function testimonial_rotator_single_wrapper( $content ) {
      if ( function_exists( 'testimonial_rotator_single' ) ) {
        $content = testimonial_rotator_single( $content );
      }
      return $content;
    }

    Other plugins are likely to abuse 'the_content' for all kinds of things. I ran into that with ninja_forms.

  3. kitchin
    Member
    Posted 10 months ago #

    Tferry, there's a quick workaround you could do in your theme's functions.php file that would probably work for this version:

    add_action( 'plugins_loaded', 'mytheme_testimonial_rotator_setup', 20 );
    function mytheme_testimonial_rotator_setup() {
      if ( ! function_exists( 'testimonial_rotator_single' ) ) {
        remove_filter( 'the_content', 'testimonial_rotator_single' );
      }
    }

    The Staff plugin is using apply_filters('the_content',...) on the admin side.

    But I did think WP was smart enough to ignore filters that aren't defined?? Maybe something worse is going on.

  4. tferry
    Member
    Posted 10 months ago #

    Thanks for responding so quickly Kitchin.

    I've tried adding in the code you suggested to my theme's functions.php file but it hasn't fixed the issue unfortunately - still getting the same error message...

  5. kitchin
    Member
    Posted 10 months ago #

    If you want to try hacking the plugin
    * only do this if you have ftp access so you can back out any php failures
    * save a copy of any file you change
    * this is for 2.0.3
    Go to plugins/testimonial_rotator/testimonial_rotator.php. Around line 33 it looks like this:

    add_filter( 'the_content', 'testimonial_rotator_single' );

    Replace it with the code I posted above in "Note to developer". That should be enough to stop the warning but maybe not resolve all conflicts.

    This whole section is done in an unusual way, so there may be other issues. The usual way, as far as I know, is to remove all this enclosing stuff:

    // SETUP
    add_action( 'plugins_loaded', 'testimonial_rotator_setup' );
    function testimonial_rotator_setup()
    {

    and the corresponding

    }

    All that's in there are add_filter's and add_action's, with one conditional: is_admin().

    Even with that you would still need the wrapper fix because the plugin does not define testimonial_rotator_single on the admin side. I think.

  6. tferry
    Member
    Posted 10 months ago #

    *sigh* I've been informed today that the Testimonial Rotator plugin functionality isn't required at the moment (though it will be in future) so this issue is on hold for now.

    I will have a go at implementing your fix when I get the chance but that won't be for a little while. I will leave this post unresolved until it's either fixed by a plugin update or by hacking it myself.

    Thanks for all your help Kitchin, much appreciated.

Reply

You must log in to post.

About this Plugin

  • Testimonial Rotator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic