prefix = framework_get_prefix(); /* Set up the widget options. */ $widget_options = array( 'classname' => 'recent-comments', 'description' => esc_html__( 'Display your site\'s recent comments.', 'wordsmith' ) ); /* Set up the widget control options. */ $control_options = array( 'width' => 200, 'height' => 350 ); /* Create the widget. */ $this->WP_Widget( "{$this->prefix}-recent-comments", __( 'Recent Comments', 'wordsmith' ), $widget_options, $control_options ); } /* Displays the widget on the front end. */ function widget( $args, $instance ) { extract( $args ); /* Arguments for the widget. */ $args['commenters_avatar'] = $instance['commenters_avatar']; $args['comment_count'] = intval( $instance['comment_count'] ); $args['commenters_name'] = $instance['commenters_name']; /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if ( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $args['comment_count'], 'post_status' => 'publish', 'status' => 'approve', ) ) ); echo '