Support » Plugin: Testimonial Rotator » Turning off pause-on-hover in widget

  • Resolved kitchin


    I didn’t see a way to turn off pause-on-hover in the widget. In version 2.0.3 it is on by default. Earlier versions do not have this feature at all, so it was off.

    The best solution would be a filter in function widget(... line 526
    After extract($args, EXTR_SKIP); there could be
    $args = apply_filters( 'testimonial_rotator_widget_args', $args );

    Next I am going to post a fix anyone can apply without hacking the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • For users, you can add this code to your theme’s functions.php. You could consider this a crazy workaround, or just a typical hook into WP. This what those hooks are for!

    * Turn off pause-on-hover in Testimonial Rotator widgets.
    * Works in Testimonial Rotator 2.0.3
    * See:
    * The technique is to hook into the WP code and detect the TR widget.
    add_filter( 'widget_display_callback', 'mytheme_testimonial_rotator_filter_widget_display_callback', 10, 2);
    function mytheme_testimonial_rotator_filter_widget_display_callback( $instance, $thisobject ) { // , $args ) {
    	$class= is_object($thisobject) ? get_class($thisobject) : '';
    	if ( $class == 'TestimonialRotatorWidget' ) {
    		if ( is_array( $instance ) ) {   // just to be sure
    			// Note, Testimonial Rotator uses $instance as an args array in the widget, so this works.
    			// The filter can get the widget $args, but that won't help because it's read-only here.
    			$instance['no_pause_on_hover']= 1;
    	return $instance;
    Plugin Author Hal Gatewood


    Just a note that I have added a filter available for the next release. I’ll post more code when it’s ready. This will simplify the whole process for you.

    Plugin Author Hal Gatewood


    You can now add this to your functions.php file in your theme folder:

    function hg_testimonial_rotator_hover( )
      return false;
    add_filter('testimonial_rotator_hover', 'hg_testimonial_rotator_hover');

    Works great, and can turn it on with an even easier one-liner:

    add_filter( 'testimonial_rotator_hover', '__return_false' );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Turning off pause-on-hover in widget’ is closed to new replies.