esc_html__('Recent Posts', 'arther'),
'post-number' => 5,
);
return $defaults;
}
public function __construct()
{
$opts = array(
'classname' => 'arther-latest',
'description' => esc_html__('Recent Posts Widget with Thumbnail.', 'arther'),
);
parent::__construct('arther-latest', esc_html__('Arther Recent Posts', 'arther'), $opts);
}
public function widget($args, $instance)
{
$instance = wp_parse_args((array)$instance, $this->defaults());
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
echo $args['before_widget'];
if (!empty($title)) {
echo $args['before_title'] . esc_html($title) . $args['after_title'];
}
$post_number = !empty($instance['post-number']) ? $instance['post-number'] : '';
?>