public static function get_testimonials_html($testimonials, $atts, $is_list = true, $widget_number = null) { global $tw_template_args; $tw_template_args = compact('testimonials', 'atts', 'is_list', 'widget_number'); $div_open = self::get_template_part('testimonials', 'open'); $paging = Axl_Testimonials_Widget_Settings::is_true($atts['paging']); $pre_paging = ''; if ($paging || 'before' === strtolower($atts['paging'])) { $pre_paging = self::get_testimonials_paging($atts); } if (empty($testimonials) && !$atts['hide_not_found']) { $testimonials = array(array('testimonial_content' => esc_html__('No testimonials found', 'testimonials-widget'))); self::set_not_found(true); } else { self::set_not_found(); } $is_first = true; $testimonial_content = ''; foreach ($testimonials as $testimonial) { $content = self::get_testimonial_html($testimonial, $atts, $is_list, $is_first, $widget_number); $content = apply_filters('tw_testimonial_html', $content, $testimonial, $atts, $is_list, $is_first, $widget_number); $testimonial_content .= $content; $is_first = false; } $post_paging = ''; if ($paging || 'after' === strtolower($atts['paging'])) { $post_paging = self::get_testimonials_paging($atts, false); } $div_close = self::get_template_part('testimonials', 'close'); $html = $div_open . $pre_paging . $testimonial_content . $post_paging . $div_close; $html = apply_filters('tw_get_testimonials_html', $html, $testimonials, $atts, $is_list, $widget_number, $div_open, $pre_paging, $testimonial_content, $post_paging, $div_close); return $html; }