widget_cssclass = 'avenews-widget-newsletter avenews-fullwidth-widget'; $this->widget_description = __("This widget effortlessly incorporates with third-party email marketing services through Shortcode, enabling you to establish a newsletter subscriptions.", 'avenews'); $this->widget_id = 'avenews_mailchimp_form'; $this->widget_name = __('Avenews: Full Width Newsletter', 'avenews'); $this->settings = array( 'title' => array( 'label' => esc_html__('Widget Title', 'avenews'), 'type' => 'text', 'class' => 'widefat', ), 'desc' => array( 'type' => 'textarea', 'label' => __('Description', 'avenews'), 'rows' => 10, ), 'form_shortcode' => array( 'type' => 'text', 'label' => __('MailChimp Form Shortcode', 'avenews'), ), 'msg' => array( 'type' => 'message', 'label' => __('Additonal Settings', 'avenews'), ), 'text_align' => array( 'type' => 'select', 'label' => __('Text Alignment', 'avenews'), 'options' => array( 'left' => __('Left Align', 'avenews'), 'center' => __('Center Align', 'avenews'), 'right' => __('Right Align', 'avenews'), ), 'std' => 'left', ), 'height' => array( 'type' => 'number', 'step' => 20, 'min' => 300, 'max' => 700, 'std' => 500, 'label' => __('Height: Between 300px and 700px (Default 400px)', 'avenews'), ), 'bg_color_option' => array( 'type' => 'color', 'label' => __('Background Color', 'avenews'), 'std' => '#000000', ), 'text_color_option' => array( 'type' => 'color', 'label' => __('Text Color', 'avenews'), 'std' => '#ffffff', ), 'bg_image' => array( 'type' => 'image', 'label' => __('Background Image', 'avenews'), 'desc' => __('Don\'t upload any image if you do not want to show the background image.', 'avenews'), ), 'overlay_opacity' => array( 'type' => 'number', 'step' => 10, 'min' => 0, 'max' => 100, 'std' => 50, 'label' => __('Overlay Opacity (Default 50%)', 'avenews'), ), 'bg_overlay_color' => array( 'type' => 'color', 'label' => __('Overlay Background Color', 'avenews'), 'std' => '#000000', ), ); parent::__construct(); } /** * Output widget. * * @param array $args * @param array $instance * @see WP_Widget * */ public function widget($args, $instance) { ob_start(); $class = ''; $image_enabled = !empty($instance['bg_image']); $bg_color_option = ""; if (isset($instance['bg_color_option'])) { $bg_color_option = $instance['bg_color_option']; } $class .= ' newsletter-align-'.$instance['text_align'] ; $style_text = 'color:' . $instance['text_color_option'] . ';'; $style_text .= 'background-color:' . $bg_color_option . ';'; $style_text .= 'min-height:' . $instance['height'] . 'px;'; echo $args['before_widget']; do_action('avenews_before_mailchimp'); ?>