prefix = framework_get_prefix(); /* Default services. */ $default_services = array( 'delicious' => 'Delicious', 'digg' => 'Digg', 'dribbble' => 'Dribbble', 'dropbox' => 'Dropbox', 'email' => 'Email', 'facebook' => 'Facebook', 'flickr' => 'Flickr', 'forrst' => 'Forrst', 'foursquare' => 'Foursquare', 'github' => 'Github', 'googleplus' => 'Google+', 'gosquared' => 'GoSquared', 'instagram' => 'Instagram', 'lastfm' => 'LastFM', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'skype' => 'Skype', 'soundcloud' => 'Soundcloud', 'spotify' => 'Spotify', 'stumbleupon' => 'Stumbleupon', 'twitter' => 'Twitter', 'vimeo' => 'Vimeo', 'yelp' => 'Yelp', 'youtube' => 'YouTube', 'zerply' => 'Zerply', 'rss' => 'RSS' ); /* Apply filters. */ $this->services = apply_filters( 'social-profiles-services', $default_services ); /* Set up the widget options. */ $widget_options = array( 'classname' => 'social-profiles', 'description' => esc_html__( 'Display links to your social profiles.', 'wordsmith' ) ); /* Set up the widget control options. */ $control_options = array( 'width' => 200, 'height' => 350 ); /* Create the widget. */ $this->WP_Widget( "{$this->prefix}-social-profiles", __( 'Social Profiles', 'wordsmith' ), $widget_options, $control_options ); } /* Outputs the widget based on the arguments input through the widget controls. */ function widget( $args, $instance ) { extract( $args ); $links = array(); foreach( $this->services as $service => $name ) { $links[$service] = esc_url( $instance[$service] ); } $links = array_filter( $links ); if ( empty( $links ) ) return false; /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if ( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; /* If a description was input by the user, display it. */ if ( !empty( $instance['description'] ) ) echo '
'; echo '