esc_html__('A widget that shows quick contact information', 'buzzstore') )); } private function widget_fields() { $fields = array( 'buzzstore_quick_contact_title' => array( 'buzzstore_widgets_name' => 'buzzstore_quick_contact_title', 'buzzstore_widgets_title' => esc_html__('Title', 'buzzstore'), 'buzzstore_widgets_field_type' => 'title', ), 'buzzstore_quick_address' => array( 'buzzstore_widgets_name' => 'buzzstore_quick_address', 'buzzstore_widgets_title' => esc_html__('Contact Address', 'buzzstore'), 'buzzstore_widgets_field_type' => 'textarea', 'buzzstore_widgets_row' => 2, ), 'buzzstore_quick_phone' => array( 'buzzstore_widgets_name' => 'buzzstore_quick_phone', 'buzzstore_widgets_title' => esc_html__('Contact Number', 'buzzstore'), 'buzzstore_widgets_field_type' => 'text', ), 'buzzstore_quick_email' => array( 'buzzstore_widgets_name' => 'buzzstore_quick_email', 'buzzstore_widgets_title' => esc_html__('Contact Email Address', 'buzzstore'), 'buzzstore_widgets_field_type' => 'text', ), 'buzzstore_opening_time' => array( 'buzzstore_widgets_name' => 'buzzstore_opening_time', 'buzzstore_widgets_title' => esc_html__('Store Opening Time', 'buzzstore'), 'buzzstore_widgets_field_type' => 'textarea', 'buzzstore_widgets_row' => 2, ), 'buzzstore_contact_color' => array( 'buzzstore_widgets_name' => 'buzzstore_contact_color', 'buzzstore_widgets_title' => esc_html__('Color', 'buzzstore'), 'buzzstore_widgets_field_type' => 'text', ), 'buzzstore_contact_layout' => array( 'buzzstore_widgets_name' => 'buzzstore_contact_layout', 'buzzstore_widgets_title' => esc_html__('Select Layout', 'buzzstore'), 'buzzstore_widgets_field_type' => 'select', 'buzzstore_widgets_default' => '', 'buzzstore_widgets_field_options' => array ( 'container' => esc_html__( 'Container Layout', 'buzzstore' ), 'full-width' => esc_html__( 'Full Width Layout', 'buzzstore' ), ), ), ); return $fields; } public function widget($args, $instance) { extract($args); extract($instance); $title = empty( $instance['buzzstore_quick_contact_title'] ) ? '' : $instance['buzzstore_quick_contact_title']; $contact_address = empty( $instance['buzzstore_quick_address'] ) ? '' : $instance['buzzstore_quick_address']; $contact_number = empty( $instance['buzzstore_quick_phone'] ) ? '' : $instance['buzzstore_quick_phone']; $phonenumber = preg_replace("/[^0-9]/","",$contact_number); $contact_email = empty( $instance['buzzstore_quick_email'] ) ? '' : $instance['buzzstore_quick_email']; $opening_time = empty( $instance['buzzstore_opening_time'] ) ? '' : $instance['buzzstore_opening_time']; $contact_color = empty( $instance['buzzstore_contact_color'] ) ? '' : $instance['buzzstore_contact_color']; $contact_layout = empty( $instance['buzzstore_contact_layout'] ) ? '' : $instance['buzzstore_contact_layout']; echo $before_widget; if ( !empty( $contact_color ) ) { $this->buzzstore_contactinfo_style( $contact_color ); } ?>