示例#1
0
function alaya_recent_comments_shortcode($atts, $content = "")
{
    extract(shortcode_atts(array('title' => 'Recent comments', 'number' => '5'), $atts));
    $str = '<div class="widget widget_alaya_recent_comments">';
    $str .= '<h6 class="widget_title">' . $title . '</h6>';
    $str .= alaya_recent_comment($number);
    $str .= '</div>';
    return $str;
}
示例#2
0
 /**
  * Front-end display of widget
  **/
 public function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', isset($instance['title']) ? esc_attr($instance['title']) : 'Latest Comments');
     $comments_show = isset($instance['comments_show']) ? esc_attr($instance['comments_show']) : '5';
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo alaya_recent_comment($comments_show);
     echo $after_widget;
 }