'himara_recent_posts_widget', 'description' => esc_html__( 'Display your category list with this widget', 'eagle' ) ); $control_ops = array( 'id_base' => 'himara_recent_posts_widget' ); parent::__construct( 'himara_recent_posts_widget', esc_html__( 'Recent Posts', 'eagle' ), $widget_ops, $control_ops ); $this->defaults = array( 'title' => esc_html__( 'himara Recent Posts', 'eagle' ), 'categories' => array(), 'count' => 1, 'class' => 'categories' ); } // WIDGET CONFIGURATION public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'himara - Recent Posts', 'eagle' ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; if ( ! $number ) { $number = 5; } $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; // WIDGET OUTPUT $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, ), $instance ) ); if ( ! $r->have_posts() ) { return; } ?> have_posts() ) : $r->the_post(); ?>
id="get_field_id( 'show_date' )); ?>" name="get_field_name( 'show_date' )); ?>" />