widget_cssclass = 'avenews-widget-image'; $this->widget_description = __("The Image Widget offers versatile design with two style variations. Effortlessly incorporate images, titles, descriptions, and links for dynamic and engaging content presentation in a single widget.", 'avenews'); $this->widget_id = 'avenews_image_widget'; $this->widget_name = __('Avenews: Image Widget', 'avenews'); $this->settings = array( 'title' => array( 'type' => 'text', 'label' => __('Widget Title', 'avenews'), ), 'title_text' => array( 'type' => 'text', 'label' => __('Widget Description', 'avenews'), ), 'bg_image' => array( 'type' => 'image', 'label' => __('Background Image', 'avenews'), ), 'btn_text' => array( 'type' => 'text', 'label' => __('Button Text', 'avenews'), ), 'btn_link' => array( 'type' => 'url', 'label' => __('Link to URL', 'avenews'), 'desc' => __('Please make sure to provide a complete URL that includes either "http://" or "https://" to ensure the widget operates correctly.', 'avenews'), ), 'link_target' => array( 'type' => 'checkbox', 'label' => __('Open Link in new Tab', 'avenews'), 'std' => true, ), 'style' => array( 'type' => 'select', 'label' => __('Style', 'avenews'), 'options' => array( 'style_1' => __('Style 1', 'avenews'), 'style_2' => __('Style 2', 'avenews'), ), 'std' => 'style_1', ), ); parent::__construct(); } /** * Output widget. * * @param array $args * @param array $instance * @see WP_Widget * */ public function widget($args, $instance) { $class = ''; ob_start(); echo $args['before_widget']; $class .= $instance['style']; do_action('avenews_before_image'); ?>