Skip to content

Instantly share code, notes, and snippets.

@subharanjanm
Last active January 27, 2016 14:15
Show Gist options
  • Save subharanjanm/054298d2e9c62157d6f7 to your computer and use it in GitHub Desktop.
Save subharanjanm/054298d2e9c62157d6f7 to your computer and use it in GitHub Desktop.
Get testimonials html controls above the testimonials slider.
<?php
function manipulate_filter_tw_get_testimonials_html() {
if ( class_exists( 'Axl_Testimonials_Widget_Premium' ) ) {
remove_filter( 'tw_get_testimonials_html', array(
'Axl_Testimonials_Widget_Premium',
'get_testimonials_html_controls'
), 10 );
add_filter( 'tw_get_testimonials_html', 'get_testimonials_html_controls_above', 10, 10 );
}
}
add_action( 'init', 'manipulate_filter_tw_get_testimonials_html' );
function get_testimonials_html_controls_above( $html, $testimonials, $atts, $is_list, $widget_number, $div_open, $pre_paging, $testimonial_content, $post_paging, $div_close ) {
switch ( $atts['type'] ) {
case 'testimonials_slider':
$show_controls = $atts['show_controls'];
if ( $show_controls ) {
$id = Axl_Testimonials_Widget::ID;
$id_base = $id . $widget_number;
$control = $id_base . '-control';
$controls = '<div class="' . $id . ' bx-controls ' . $control . '"></div><div style="clear:both;">&nbsp;</div>';
$html = $controls . $html;
}
break;
}
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment