'arixwp_recent_comments', 'description' => __( 'Shows the most recent comments along with the authors avatar.', THEMENAME ) ); parent::WP_Widget(false,$name= "arixWP Comments",$widgets_opt); } // User Options Form function form($instance) { $this->arixwp_recent_comments_title = ( !empty($instance['title'])) ? esc_attr($instance['title']) : ''; $this->arixwp_recent_comments_total = ( !empty( $instance['arixwp_recent_comments_total'] ) ) ? esc_attr( $instance['arixwp_recent_comments_total'] ) : ''; $this->arixwp_recent_comments_avatar = ( !empty( $instance['arixwp_recent_comments_avatar'] ) ) ? esc_attr( $instance['arixwp_recent_comments_avatar'] ) : ''; ?>
arixwp_recent_comments_title = ( !empty( $instance['title'] ) ) ? apply_filters( 'title',$instance['title'] ) : __(ARIXWP_RC_WIDGET_TITLE, THEMENAME); $this->arixwp_recent_comments_total = ( !empty( $instance['arixwp_recent_comments_total'] ) ) ? apply_filters( 'arixwp_recent_comments_total',$instance['arixwp_recent_comments_total'] ) : ARIXWP_RC_WIDGET_NUM; $this->arixwp_recent_comments_avatar = ( !empty( $instance['arixwp_recent_comments_avatar'] ) ) ? apply_filters( 'arixwp_recent_comments_avatar',$instance['arixwp_recent_comments_avatar'] ) : ARIXWP_RC_WIDGET_AVATAR_SIZE; echo $before_widget; $arixwp_recent_comments_title2 = preg_replace('/(^[A-z0-9_]+)\s/i', '$1 ', $this->arixwp_recent_comments_title); $title = $before_title.$arixwp_recent_comments_title2.$after_title; echo $title; $this->doWidgetLogic($args); wp_reset_query(); echo $after_widget; } function doWidgetLogic($args) { extract($args); $widget_id = (!empty($widget_id)) ? $widget_id : ''; $recent_comments = get_comments( array( 'number' => $this->arixwp_recent_comments_total, 'status' => 'approve' ) ); echo '
' . $commentcontent . '... More
'; echo ' '; echo '