esc_html__('A widget that promote you busincess', 'sparklestore') )); } private function widget_fields() { $fields = array( 'sparklestore_full_promo_page' => array( 'sparklestore_widgets_name' => 'sparklestore_full_promo_page', 'sparklestore_widgets_title' => esc_html__('Select Promo Page', 'sparklestore'), 'sparklestore_widgets_field_type' => 'selectpage' ), 'sparklestore_full_promo_button_link' => array( 'sparklestore_widgets_name' => 'sparklestore_full_promo_button_link', 'sparklestore_widgets_title' => esc_html__('Promo Button Link', 'sparklestore'), 'sparklestore_widgets_field_type' => 'url', ), 'sparklestore_full_promo_button_text' => array( 'sparklestore_widgets_name' => 'sparklestore_full_promo_button_text', 'sparklestore_widgets_title' => esc_html__('Promo Button Text', 'sparklestore'), 'sparklestore_widgets_field_type' => 'text', ), 'sparklestore_promo_info' => array( 'sparklestore_widgets_name' => 'sparklestore_promo_info', 'sparklestore_widgets_title' => esc_html__('Check to Disable Promo Information', 'sparklestore'), 'sparklestore_widgets_field_type' => 'checkbox', ), ); return $fields; } public function widget($args, $instance) { extract($args); extract($instance); $sparklestore_full_promo_page = empty( $instance['sparklestore_full_promo_page'] ) ? '' : $instance['sparklestore_full_promo_page']; $button_link = empty( $instance['sparklestore_full_promo_button_link'] ) ? '' : $instance['sparklestore_full_promo_button_link']; $button_text = empty( $instance['sparklestore_full_promo_button_text'] ) ? '' : $instance['sparklestore_full_promo_button_text']; $promo_info = empty( $instance['sparklestore_promo_info'] ) ? '' : $instance['sparklestore_promo_info']; echo $before_widget; ?>
widget_fields(); foreach ($widget_fields as $widget_field) { extract($widget_field); $instance[$sparklestore_widgets_name] = sparklestore_widgets_updated_field_value($widget_field, $new_instance[$sparklestore_widgets_name]); } return $instance; } public function form($instance) { $widget_fields = $this->widget_fields(); foreach ($widget_fields as $widget_field) { extract($widget_field); $sparklestore_widgets_field_value = !empty($instance[$sparklestore_widgets_name]) ? $instance[$sparklestore_widgets_name] : ''; sparklestore_widgets_show_widget_field($this, $widget_field, $sparklestore_widgets_field_value); } } }