__('A widget that shows about us information', 'buzzstore') )); } private function widget_fields() { $fields = array( 'buzzstore_about_logo' => array( 'buzzstore_widgets_name' => 'buzzstore_about_logo', 'buzzstore_widgets_title' => __('Upload Logo Image', 'buzzstore'), 'buzzstore_widgets_field_type' => 'upload', ), 'buzzstore_about_short_desc' => array( 'buzzstore_widgets_name' => 'buzzstore_about_short_desc', 'buzzstore_widgets_title' => __('Short Description', 'buzzstore'), 'buzzstore_widgets_field_type' => 'textarea', 'buzzstore_widgets_row' => '3' ), 'buzzstore_facebook_url' => array( 'buzzstore_widgets_name' => 'buzzstore_facebook_url', 'buzzstore_widgets_title' => __('Facebook Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), 'buzzstore_twitter_url' => array( 'buzzstore_widgets_name' => 'buzzstore_twitter_url', 'buzzstore_widgets_title' => __('Twitter Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), 'buzzstore_googleplus_url' => array( 'buzzstore_widgets_name' => 'buzzstore_googleplus_url', 'buzzstore_widgets_title' => __('Google Plus Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), 'buzzstore_youtube_url' => array( 'buzzstore_widgets_name' => 'buzzstore_youtube_url', 'buzzstore_widgets_title' => __('Youtube Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), 'buzzstore_instagram_url' => array( 'buzzstore_widgets_name' => 'buzzstore_instagram_url', 'buzzstore_widgets_title' => __('Instagram Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), 'buzzstore_pinterest_url' => array( 'buzzstore_widgets_name' => 'buzzstore_pinterest_url', 'buzzstore_widgets_title' => __('Pinterest Url', 'buzzstore'), 'buzzstore_widgets_field_type' => 'url', ), ); return $fields; } public function widget($args, $instance) { extract($args); extract($instance); $logo = $instance['buzzstore_about_logo']; $shor_desc = $instance['buzzstore_about_short_desc']; $facebook = $instance['buzzstore_facebook_url']; $twitter = $instance['buzzstore_twitter_url']; $googleplus = $instance['buzzstore_googleplus_url']; $youtube = $instance['buzzstore_youtube_url']; $instagram = $instance['buzzstore_instagram_url']; $pinterest = $instance['buzzstore_pinterest_url']; echo $before_widget; ?>
widget_fields(); foreach ($widget_fields as $widget_field) { extract($widget_field); $instance[$buzzstore_widgets_name] = buzzstore_widgets_updated_field_value($widget_field, $new_instance[$buzzstore_widgets_name]); } return $instance; } public function form($instance) { $widget_fields = $this->widget_fields(); foreach ($widget_fields as $widget_field) { extract($widget_field); $buzzstore_widgets_field_value = !empty($instance[$buzzstore_widgets_name]) ? esc_attr($instance[$buzzstore_widgets_name]) : ''; buzzstore_widgets_show_widget_field($this, $widget_field, $buzzstore_widgets_field_value); } } }