esc_html__('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' => esc_html__('Title', 'sparklestore'), 'sparklestore_widgets_field_type' => 'title', ), 'sparklestore_quick_address' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_address', 'sparklestore_widgets_title' => esc_html__('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' => esc_html__('Contact Number', 'sparklestore'), 'sparklestore_widgets_field_type' => 'text', ), 'sparklestore_quick_email' => array( 'sparklestore_widgets_name' => 'sparklestore_quick_email', 'sparklestore_widgets_title' => esc_html__('Contact Email Address', 'sparklestore'), 'sparklestore_widgets_field_type' => 'text', ) ); return $fields; } public function widget($args, $instance) { extract($args); extract($instance); $title = empty( $instance['sparklestore_quick_contact_title'] ) ? '' : $instance['sparklestore_quick_contact_title']; $contact_address = empty( $instance['sparklestore_quick_address'] ) ? '' : $instance['sparklestore_quick_address']; $contact_number = empty( $instance['sparklestore_quick_phone'] ) ? '' : $instance['sparklestore_quick_phone']; $phone_number = preg_replace("/[^0-9]/","", $contact_number); $contact_email = empty( $instance['sparklestore_quick_email'] ) ? '' : $instance['sparklestore_quick_email'] ; echo $before_widget; if(!empty($title)) { echo '