/**
     * Outputs the settings form for the Recent Comments widget.
     *
     * @param array $instance Current settings.
     */
    public function form($instance)
    {
        $show_date = isset($instance['show_date']) ? (bool) $instance['show_date'] : false;
        parent::form($instance);
        ?>
        <p><input class="checkbox" type="checkbox"<?php 
        checked($show_date);
        ?>
 id="<?php 
        echo $this->get_field_id('show_date');
        ?>
" name="<?php 
        echo $this->get_field_name('show_date');
        ?>
" />
            <label for="<?php 
        echo $this->get_field_id('show_date');
        ?>
"><?php 
        _e('Display comment date?', 'basicbootstrap');
        ?>
</label></p>
        <?php 
    }
Esempio n. 2
0
 function is_preview()
 {
     return version_compare($GLOBALS['wp_version'], '3.9', '<') ? false : parent::is_preview();
 }
 function MY_CommentWidget()
 {
     parent::WP_Widget('my-recent-comments', $name = theme_locals("recent_comments"));
 }
 function MY_CommentWidget()
 {
     parent::WP_Widget('my-recent-comments', $name = __('Cherry - Recent Comments', CHERRY_PLUGIN_DOMAIN));
 }
function wpmp_theme_widget_recent_comments($args, $widget_args = 1)
{
    ob_start();
    if (function_exists('wp_widget_recent_comments')) {
        wp_widget_recent_comments($args);
    } else {
        $widget = new WP_Widget_Recent_Comments();
        $widget->display_callback($args, $widget_args);
    }
    $original = ob_get_contents();
    ob_end_clean();
    $original = str_ireplace('<ul id="recentcomments"></ul>', '<ul id="recentcomments"><li>' . __('No comments', 'wpmp') . '</li></ul>', $original);
    $original = str_ireplace("&cpage", "&amp;cpage", $original);
    print $original;
}
Esempio n. 6
0
 /**
  * @package WP Idea Stream
  * @subpackage comments/widgets
  *
  * @since 2.0.0
  * @param  array $args
  * @param  array $instance
  * @uses   add_filter() to templorarly filter the comments query args
  * @uses   parent::widget() to display the widget
  * @uses   remove_filter() to remove the temporary filter
  */
 public function widget($args, $instance)
 {
     /**
      * Add filter so that post type used is ideas but before the dummy var
      * @see WP_Idea_Stream_Comments::comments_widget_dummy_var()
      */
     add_filter('widget_comments_args', array($this, 'override_comment_args'), 5, 1);
     parent::widget($args, $instance);
     /**
      * Once done we need to remove the filter
      */
     remove_filter('widget_comments_args', array($this, 'override_comment_args'), 5, 1);
 }