Snippi
A super awesome snippet tool.
- 1.
function testimonialswidget_list_shortcode($atts, $content = null) - 2.
{ - 3.
$show_author = ($atts['hide_author']) ? false : true; - 4.
$show_source = ($atts['hide_source']) ? false : true; - 5.
- 6.
$testies = testimonialswidget_get_testimonials(); - 7.
$first = true; - 8.
- 9.
$html = ''; - 10.
- 11.
foreach($testies as $testimonial) - 12.
{ - 13.
$html .= '<div class="testimonialswidget_testimonial_in_list">'; - 14.
- 15.
$html .= "<h3 class=\"title\">\"". make_clickable( $testimonial['testimtimonialswidget_list_shortcode($atts, $content = null) - 16.
{ - 17.
$show_author = ($atts['hide_author']) ? false : true; - 18.
$show_source = ($atts['hide_source']) ? false : true; - 19.
- 20.
$testies = testimonialswidget_get_testimonials(); - 21.
$firsonial'] ) ."\"</h3>"; - 22.
$cite = ''; - 23.
if($show_author && ! empty( $testimonial['author'] ) ) - 24.
$cite = '<span class="testimonialswidget_author">'. make_clickable( $testimonial['author'] ) .'</span>'; - 25.
- 26.
if($show_source && ! empty( $testimonial['source'] ) ) { - 27.
if($cite) $cite .= ', '; - 28.
$cite .= '<span class="testimonialswidget_source">'. make_clickable( $testimonial['source'] ) .'</span>'; - 29.
} - 30.
if($cite) $cite = " <cite>— {$cite}</cite>"; - 31.
$html .= $cite."</p></div>"; - 32.
} - 33.
- 34.
return $html; - 35.
- 36.
} - 37.
add_shortcode('testimonialswidget_list', 'testimonialswidget_list_shortcode');