esc_html__( 'Widget for Latest posts', 'bosa' ) ) ); $defaults = array( 'per_page' => 5, 'show_date_comment' => true, 'layout' => 'left' ); $this->defaults = apply_filters( 'bosa_rcs_widget_default', $defaults ); $this->fields = array( 'title' => array( 'label' => esc_html__( 'Title', 'bosa' ), 'type' => 'text' ), 'per_page' => array( 'label' => esc_html__( 'Number of Posts', 'bosa' ), 'type' => 'number', 'min' => 1, 'max' => $this->defaults[ 'per_page' ], 'default' => $this->defaults[ 'per_page' ], ), 'show_date_comment' => array( 'label' => esc_html__( 'Show Date & Comments', 'bosa' ), 'type' => 'checkbox', 'default' => $this->defaults[ 'show_date_comment' ] ), 'layout' => array( 'label' => esc_html__( 'Layout', 'bosa' ), 'type' => 'radio', 'choices' => array( 'left' => esc_html__( 'Left Thumbnail', 'bosa' ), 'full' => esc_html__( 'Full Thumbnail', 'bosa' ) ), 'default' => $this->defaults[ 'layout' ] ) ); } public function widget( $args, $instance ){ echo $args[ 'before_widget' ]; $instance = $this->init_defaults( $instance ); $query_args = apply_filters( 'bosa_post_widget_query_args', array( 'posts_per_page' => $instance[ 'per_page' ], 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => 1 ), $instance ); $class = ( 'left' == $instance[ 'layout' ] ) ? 'left-thumb-widget' : 'full-thumb-widget'; ?>
query_it( $query_args, $instance ); ?>
have_posts() ){ while ( $query->have_posts() ){ $query->the_post(); $this->item( $instance ); } }else{ ?>

<?php echo $alt; ?>

approved ); ?>