widget_cssclass = 'widget_aytias_call_to_action'; $this->widget_description = __("Adds Call to action section", 'aytias'); $this->widget_id = 'aytias_call_to_action'; $this->widget_name = __('Aytias: Call To Action', 'aytias'); $this->settings = array( 'title' => array( 'type' => 'text', 'label' => __('Widget Title', 'aytias'), ), 'title_text' => array( 'type' => 'text', 'label' => __('CTA Title', 'aytias'), ), 'desc' => array( 'type' => 'textarea', 'label' => __( 'CTA Description', 'aytias' ), 'rows' => 10, ), 'bg_image' => array( 'type' => 'image', 'label' => __( 'Background Image', 'aytias' ), ), 'btn_text' => array( 'type' => 'text', 'label' => __( 'Button Text', 'aytias' ), ), 'btn_link' => array( 'type' => 'url', 'label' => __( 'Link to url', 'aytias' ), 'desc' => __( 'Enter a proper url with http: OR https:', 'aytias' ), ), 'link_target' => array( 'type' => 'checkbox', 'label' => __( 'Open Link in new Tab', 'aytias' ), 'std' => true, ), 'msg' => array( 'type' => 'message', 'label' => __('Additonal Settings', 'aytias'), ), 'enable_fixed_bg' => array( 'type' => 'checkbox', 'label' => __( 'Enable Fixed Background Image', 'aytias' ), 'std' => true, ), 'bg_overlay_color' => array( 'type' => 'color', 'label' => __( 'Overlay Color', 'aytias' ), 'std' => '#000000', ), 'overlay_opacity' => array( 'type' => 'number', 'step' => 10, 'min' => 0, 'max' => 100, 'std' => 50, 'label' => __('Overlay Opacity (Default 50%)', 'aytias'), ), ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget($args, $instance) { ob_start(); $this->widget_start($args, $instance); do_action( 'aytias_before_cta'); ?>
widget_end($args); echo ob_get_clean(); } }