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: http://wordpress.org/support/topic/turning-off-pause-on-hover-in-widget
* 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;
}
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.
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' );