'widget-social', 'description' => esc_html__( 'Show Icons of your Social Links.', 'biscuit-lite' ) ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'biscuit_lite_social' ); /* Create the widget. */ parent::__construct( 'biscuit_lite_social', esc_html__( 'Social Links (Biscuit)', 'biscuit-lite' ), $widget_ops, $control_ops ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', ! empty( $instance['title'] ) ? $instance['title'] : '' ); $feed = ! empty( $instance['feed'] ) ? $instance['feed'] : ''; $email = ! empty( $instance['email'] ) ? $instance['email'] : ''; $linkedin = ! empty( $instance['linkedin'] ) ? $instance['linkedin'] : ''; $bloglovin = ! empty( $instance['bloglovin'] ) ? $instance['bloglovin'] : ''; $twitter = ! empty( $instance['twitter'] ) ? $instance['twitter'] : ''; $facebook = ! empty( $instance['facebook'] ) ? $instance['facebook'] : ''; $googleplus = ! empty( $instance['googleplus'] ) ? $instance['googleplus'] : ''; $pinterest = ! empty( $instance['pinterest'] ) ? $instance['pinterest'] : ''; $instagram = ! empty( $instance['instagram'] ) ? $instance['instagram'] : ''; $flickr = ! empty( $instance['flickr'] ) ? $instance['flickr'] : ''; $youtube = ! empty( $instance['youtube'] ) ? $instance['youtube'] : ''; $vimeo = ! empty( $instance['vimeo'] ) ? $instance['vimeo'] : ''; $dribbble = ! empty( $instance['dribbble'] ) ? $instance['dribbble'] : ''; $behance = ! empty( $instance['behance'] ) ? $instance['behance'] : ''; $github = ! empty( $instance['github'] ) ? $instance['github'] : ''; $skype = ! empty( $instance['skype'] ) ? $instance['skype'] : ''; $tumblr = ! empty( $instance['tumblr'] ) ? $instance['tumblr'] : ''; $wordpress = ! empty( $instance['wordpress'] ) ? $instance['wordpress'] : ''; $soundcloud = ! empty( $instance['soundcloud'] ) ? $instance['soundcloud'] : ''; $medium = ! empty( $instance['medium'] ) ? $instance['medium'] : ''; $snapchat = ! empty( $instance['snapchat'] ) ? $instance['snapchat'] : ''; /* Before widget (defined by themes). */ echo wp_kses_post($before_widget); if ( $title ) echo wp_kses_post($before_title) . esc_html($title) . wp_kses_post($after_title); if ( $feed ) echo ''; if ( $email ) echo ''; if ( $linkedin ) echo ''; if ( $bloglovin ) echo ''; if ( $twitter ) echo ''; if ( $facebook ) echo ''; if ( $googleplus ) echo ''; if ( $pinterest ) echo ''; if ( $instagram ) echo ''; if ( $flickr ) echo ''; if ( $youtube ) echo ''; if ( $vimeo ) echo ''; if ( $dribbble ) echo ''; if ( $behance ) echo ''; if ( $github ) echo ''; if ( $skype ) echo ''; if ( $tumblr ) echo ''; if ( $wordpress ) echo ''; if ( $soundcloud ) echo ''; if ( $medium ) echo ''; if ( $snapchat ) echo ''; /* After widget (defined by themes). */ echo wp_kses_post($after_widget); } /** * Processing widget options on save * * @param array $new_instance The new options * @param array $old_instance The previous options */ public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; $instance['feed'] = ( ! empty( $new_instance['feed'] ) ) ? esc_url_raw( $new_instance['feed'] ) : ''; $instance['email'] = ( ! empty( $new_instance['email'] ) ) ? esc_url_raw( $new_instance['email'] ) : ''; $instance['linkedin'] = ( ! empty( $new_instance['linkedin'] ) ) ? esc_url_raw( $new_instance['linkedin'] ) : ''; $instance['bloglovin'] = ( ! empty( $new_instance['bloglovin'] ) ) ? esc_url_raw( $new_instance['bloglovin'] ) : ''; $instance['twitter'] = ( ! empty( $new_instance['twitter'] ) ) ? esc_url_raw( $new_instance['twitter'] ) : ''; $instance['facebook'] = ( ! empty( $new_instance['facebook'] ) ) ? esc_url_raw( $new_instance['facebook'] ) : ''; $instance['googleplus'] = ( ! empty( $new_instance['googleplus'] ) ) ? esc_url_raw( $new_instance['googleplus'] ) : ''; $instance['pinterest'] = ( ! empty( $new_instance['pinterest'] ) ) ? esc_url_raw( $new_instance['pinterest'] ) : ''; $instance['instagram'] = ( ! empty( $new_instance['instagram'] ) ) ? esc_url_raw( $new_instance['instagram'] ) : ''; $instance['flickr'] = ( ! empty( $new_instance['flickr'] ) ) ? esc_url_raw( $new_instance['flickr'] ) : ''; $instance['youtube'] = ( ! empty( $new_instance['youtube'] ) ) ? esc_url_raw( $new_instance['youtube'] ) : ''; $instance['vimeo'] = ( ! empty( $new_instance['vimeo'] ) ) ? esc_url_raw( $new_instance['vimeo'] ) : ''; $instance['dribbble'] = ( ! empty( $new_instance['dribbble'] ) ) ? esc_url_raw( $new_instance['dribbble'] ) : ''; $instance['behance'] = ( ! empty( $new_instance['behance'] ) ) ? esc_url_raw( $new_instance['behance'] ) : ''; $instance['github'] = ( ! empty( $new_instance['github'] ) ) ? esc_url_raw( $new_instance['github'] ) : ''; $instance['skype'] = ( ! empty( $new_instance['skype'] ) ) ? esc_url_raw( $new_instance['skype'] ) : ''; $instance['tumblr'] = ( ! empty( $new_instance['tumblr'] ) ) ? esc_url_raw( $new_instance['tumblr'] ) : ''; $instance['wordpress'] = ( ! empty( $new_instance['wordpress'] ) ) ? esc_url_raw( $new_instance['wordpress'] ) : ''; $instance['soundcloud'] = ( ! empty( $new_instance['soundcloud'] ) ) ? esc_url_raw( $new_instance['soundcloud'] ) : ''; $instance['medium'] = ( ! empty( $new_instance['medium'] ) ) ? esc_url_raw( $new_instance['medium'] ) : ''; $instance['snapchat'] = ( ! empty( $new_instance['snapchat'] ) ) ? esc_url_raw( $new_instance['snapchat'] ) : ''; return $instance; } /** * Outputs the options form on admin * * @param array $instance The widget options */ public function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Follow Me', 'biscuit-lite' ); $feed = ! empty( $instance['feed'] ) ? $instance['feed'] : ''; $email = ! empty( $instance['email'] ) ? $instance['email'] : ''; $linkedin = ! empty( $instance['linkedin'] ) ? $instance['linkedin'] : ''; $bloglovin = ! empty( $instance['bloglovin'] ) ? $instance['bloglovin'] : ''; $twitter = ! empty( $instance['twitter'] ) ? $instance['twitter'] : ''; $facebook = ! empty( $instance['facebook'] ) ? $instance['facebook'] : ''; $googleplus = ! empty( $instance['googleplus'] ) ? $instance['googleplus'] : ''; $pinterest = ! empty( $instance['pinterest'] ) ? $instance['pinterest'] : ''; $instagram = ! empty( $instance['instagram'] ) ? $instance['instagram'] : ''; $flickr = ! empty( $instance['flickr'] ) ? $instance['flickr'] : ''; $youtube = ! empty( $instance['youtube'] ) ? $instance['youtube'] : ''; $vimeo = ! empty( $instance['vimeo'] ) ? $instance['vimeo'] : ''; $dribbble = ! empty( $instance['dribbble'] ) ? $instance['dribbble'] : ''; $behance = ! empty( $instance['behance'] ) ? $instance['behance'] : ''; $github = ! empty( $instance['github'] ) ? $instance['github'] : ''; $skype = ! empty( $instance['skype'] ) ? $instance['skype'] : ''; $tumblr = ! empty( $instance['tumblr'] ) ? $instance['tumblr'] : ''; $wordpress = ! empty( $instance['wordpress'] ) ? $instance['wordpress'] : ''; $soundcloud = ! empty( $instance['soundcloud'] ) ? $instance['soundcloud'] : ''; $medium = ! empty( $instance['medium'] ) ? $instance['medium'] : ''; $snapchat = ! empty( $instance['snapchat'] ) ? $instance['snapchat'] : ''; ?>

'widget-about', 'description' => esc_html__( 'About Widget with your image and description.', 'biscuit-lite' ) ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'biscuit_lite_about' ); /* Create the widget. */ parent::__construct( 'biscuit_lite_about', esc_html__( 'About (Biscuit)', 'biscuit-lite' ), $widget_ops, $control_ops ); add_action('admin_enqueue_scripts', array($this, 'upload_scripts')); } /** * Upload the Javascripts for the media uploader */ public function upload_scripts() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_script('upload_media_widget', get_template_directory_uri() . '/js/upload-media.js', array('jquery')); wp_enqueue_style('thickbox'); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', ! empty( $instance['title'] ) ? $instance['title'] : '' ); $image = ! empty( $instance['image'] ) ? $instance['image'] : ''; $imagealt = ! empty( $instance['imagealt'] ) ? $instance['imagealt'] : ''; $imagewidth = ! empty( $instance['imagewidth'] ) ? $instance['imagewidth'] : ''; $imageheight = ! empty( $instance['imageheight'] ) ? $instance['imageheight'] : ''; $aboutdescription = ! empty( $instance['aboutdescription'] ) ? $instance['aboutdescription'] : ''; $abouturltext = ! empty( $instance['abouturltext'] ) ? $instance['abouturltext'] : ''; $abouturl = ! empty( $instance['abouturl'] ) ? $instance['abouturl'] : ''; echo wp_kses_post($args['before_widget']); ?>
<?php echo esc_attr( $imagealt ); ?>
'. esc_html( $title ).''; ?>