Return to Snippet

Revision: 36902
at November 30, 2010 02:17 by mrwolfgraphics


Initial Code
<?php
class wpe_comment_widget extends WP_Widget {
    function wpe_comment_widget() {
        $widget_ops = array('classname' => 'wpe_widget_comments', 'description' => __( 'Your comments and commentform', 'your_textdomain') );
        $this->WP_Widget('wpe-comment-widget', __('WPE Comments', 'your_textdomain'), $widget_ops);
    }
    function widget($args, $instance) {
        if(is_single()) {
            extract($args);
            global $post;
            echo $before_widget;
            comments_template();
            echo $after_widget;
        }
    }
    function update($new_instance, $old_instance) {
        $instance = $old_instance;
        return $instance;
    }
    function form($instance) {
        ?>
        <p><?php _e('This widget will only be displayed in single view.', 'your_textdomain'); ?></p>
       <?php
    }
}
register_widget('wpe_comment_widget');
?>

Initial URL
http://wpengineer.com/1875/advent-calendar-24-days-tips-and-tricks-each-day-today-wordpress-comment-form-widget/

Initial Description

                                

Initial Title
WordPress Comment Form Widget

Initial Tags

                                

Initial Language
PHP