__('A widget that shows quick contact information', 'sparklestore') )); } private function widget_fields() { $fields = array( 'sparklestore_quick_contact_title' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_contact_title', 'sparklestore_widgets_title' => __('Title', 'sparklestore'), 'sparklestore_widgets_field_type' => 'title', ), 'sparklestore_quick_address' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_address', 'sparklestore_widgets_title' => __('Contact Address', 'sparklestore'), 'sparklestore_widgets_field_type' => 'textarea', 'sparklestore_widgets_row' => 4, ), 'sparklestore_quick_phone' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_phone', 'sparklestore_widgets_title' => __('Contact Number', 'sparklestore'), 'sparklestore_widgets_field_type' => 'text', ), 'sparklestore_quick_email' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_email', 'sparklestore_widgets_title' => __('Contact Email Address', 'sparklestore'), 'sparklestore_widgets_field_type' => 'text', ) ); return $fields; } public function widget($args, $instance) { extract($args); extract($instance); $title = esc_attr( $instance['sparklestore_quick_contact_title'] ); $contact_address = esc_textarea( $instance['sparklestore_quick_address'] ); $contact_number = esc_attr( $instance['sparklestore_quick_phone'] ); $contact_email = esc_attr( $instance['sparklestore_quick_email'] ); echo $before_widget; if(!empty($title)) { echo '

'.$title.'

'; } ?>
 
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]) ? esc_attr($instance[$sparklestore_widgets_name]) : ''; sparklestore_widgets_show_widget_field($this, $widget_field, $sparklestore_widgets_field_value); } } }