__( 'A widget to show recent posts', 'beka' ), ) ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $quantity = absint( $instance['quantity'] ); $show_thumb = (int) $instance['show_thumb']; $show_cat = (int) $instance['show_cat']; // before and after widget arguments are defined by themes echo $args['before_widget']; if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } ?>
__( 'Recent Posts', 'beka' ), 'quantity' => 4, 'show_thumb' => 1, 'show_cat' => 1, ); $instance = wp_parse_args( (array) $instance, $defaults ); $quantity = absint( $instance['quantity'] ); $show_thumb = isset( $instance['show_thumb'] ) ? intval( $instance['show_thumb'] ) : 1; $show_cat = isset( $instance['show_cat'] ) ? intval( $instance['show_cat'] ) : 1; ?>