Social Icons Widget - Version 14.07

Version Description

  • Added 500px, Codepen, Envato, Kickstarter, Speaker Deck, Vine
  • Removed Forrst
  • Added ability to filter opening, closing tags and HTML for icon output.
  • Added target="_blank" for links to open in a new window by default.
Download this release

Release Info

Developer dannisbet
Plugin Icon 128x128 Social Icons Widget
Version 14.07
Comparing to
See all releases

Code changes from version 14.05 to 14.07

css/social_icons_admin.css CHANGED
@@ -15,28 +15,33 @@
15
  }
16
 
17
  /* Icons for admin widget */
 
18
  .social_icons_widget .aboutme { background-image:url('../icons/small/aboutme.jpg'); }
19
  .social_icons_widget .behance { background-image:url('../icons/small/behance.jpg'); }
 
20
  .social_icons_widget .dribbble { background-image:url('../icons/small/dribbble.jpg'); }
21
  .social_icons_widget .email { background-image:url('../icons/small/email.jpg'); }
 
22
  .social_icons_widget .facebook { background-image:url('../icons/small/facebook.jpg'); }
23
  .social_icons_widget .flickr { background-image:url('../icons/small/flickr.jpg'); }
24
- .social_icons_widget .forrst { background-image:url('../icons/small/forrst.jpg'); }
25
  .social_icons_widget .foursquare { background-image:url('../icons/small/foursquare.jpg'); }
26
  .social_icons_widget .github { background-image:url('../icons/small/github.jpg'); }
27
  .social_icons_widget .googleplus { background-image:url('../icons/small/googleplus.jpg'); }
28
  .social_icons_widget .instagram { background-image:url('../icons/small/instagram.jpg'); }
 
29
  .social_icons_widget .klout { background-image:url('../icons/small/klout.jpg'); }
30
  .social_icons_widget .linkedin { background-image:url('../icons/small/linkedin.jpg'); }
31
  .social_icons_widget .medium { background-image:url('../icons/small/medium.jpg'); }
32
  .social_icons_widget .path { background-image:url('../icons/small/path.jpg'); }
33
  .social_icons_widget .pinterest { background-image:url('../icons/small/pinterest.jpg'); }
34
  .social_icons_widget .rss { background-image:url('../icons/small/rss.jpg'); }
 
35
  .social_icons_widget .stumbleupon { background-image:url('../icons/small/stumbleupon.jpg'); }
36
  .social_icons_widget .technorati { background-image:url('../icons/small/technorati.jpg'); }
37
  .social_icons_widget .tumblr { background-image:url('../icons/small/tumblr.jpg'); }
38
  .social_icons_widget .twitter { background-image:url('../icons/small/twitter.jpg'); }
39
  .social_icons_widget .vimeo { background-image:url('../icons/small/vimeo.jpg'); }
 
40
  .social_icons_widget .wordpress { background-image:url('../icons/small/wordpress.jpg'); }
41
  .social_icons_widget .yelp { background-image:url('../icons/small/yelp.jpg'); }
42
  .social_icons_widget .youtube { background-image:url('../icons/small/youtube.jpg'); }
15
  }
16
 
17
  /* Icons for admin widget */
18
+ .social_icons_widget .fivehundredpx { background-image:url('../icons/small/fivehundredpx.jpg'); }
19
  .social_icons_widget .aboutme { background-image:url('../icons/small/aboutme.jpg'); }
20
  .social_icons_widget .behance { background-image:url('../icons/small/behance.jpg'); }
21
+ .social_icons_widget .codepen { background-image:url('../icons/small/codepen.jpg'); }
22
  .social_icons_widget .dribbble { background-image:url('../icons/small/dribbble.jpg'); }
23
  .social_icons_widget .email { background-image:url('../icons/small/email.jpg'); }
24
+ .social_icons_widget .envato { background-image:url('../icons/small/envato.jpg'); }
25
  .social_icons_widget .facebook { background-image:url('../icons/small/facebook.jpg'); }
26
  .social_icons_widget .flickr { background-image:url('../icons/small/flickr.jpg'); }
 
27
  .social_icons_widget .foursquare { background-image:url('../icons/small/foursquare.jpg'); }
28
  .social_icons_widget .github { background-image:url('../icons/small/github.jpg'); }
29
  .social_icons_widget .googleplus { background-image:url('../icons/small/googleplus.jpg'); }
30
  .social_icons_widget .instagram { background-image:url('../icons/small/instagram.jpg'); }
31
+ .social_icons_widget .kickstarter { background-image:url('../icons/small/kickstarter.jpg'); }
32
  .social_icons_widget .klout { background-image:url('../icons/small/klout.jpg'); }
33
  .social_icons_widget .linkedin { background-image:url('../icons/small/linkedin.jpg'); }
34
  .social_icons_widget .medium { background-image:url('../icons/small/medium.jpg'); }
35
  .social_icons_widget .path { background-image:url('../icons/small/path.jpg'); }
36
  .social_icons_widget .pinterest { background-image:url('../icons/small/pinterest.jpg'); }
37
  .social_icons_widget .rss { background-image:url('../icons/small/rss.jpg'); }
38
+ .social_icons_widget .speakerdeck { background-image:url('../icons/small/speakerdeck.jpg'); }
39
  .social_icons_widget .stumbleupon { background-image:url('../icons/small/stumbleupon.jpg'); }
40
  .social_icons_widget .technorati { background-image:url('../icons/small/technorati.jpg'); }
41
  .social_icons_widget .tumblr { background-image:url('../icons/small/tumblr.jpg'); }
42
  .social_icons_widget .twitter { background-image:url('../icons/small/twitter.jpg'); }
43
  .social_icons_widget .vimeo { background-image:url('../icons/small/vimeo.jpg'); }
44
+ .social_icons_widget .vine { background-image:url('../icons/small/vine.jpg'); }
45
  .social_icons_widget .wordpress { background-image:url('../icons/small/wordpress.jpg'); }
46
  .social_icons_widget .yelp { background-image:url('../icons/small/yelp.jpg'); }
47
  .social_icons_widget .youtube { background-image:url('../icons/small/youtube.jpg'); }
icons/large/codepen.jpg ADDED
Binary file
icons/large/envato.jpg ADDED
Binary file
icons/large/fivehundredpx.jpg ADDED
Binary file
icons/large/forrst.jpg DELETED
Binary file
icons/large/kickstarter.jpg ADDED
Binary file
icons/large/speakerdeck.jpg ADDED
Binary file
icons/large/vine.jpg ADDED
Binary file
icons/medium/codepen.jpg ADDED
Binary file
icons/medium/envato.jpg ADDED
Binary file
icons/medium/fivehundredpx.jpg ADDED
Binary file
icons/medium/forrst.jpg DELETED
Binary file
icons/medium/kickstarter.jpg ADDED
Binary file
icons/medium/speakerdeck.jpg ADDED
Binary file
icons/medium/vine.jpg ADDED
Binary file
icons/small/codepen.jpg ADDED
Binary file
icons/small/envato.jpg ADDED
Binary file
icons/small/fivehundredpx.jpg ADDED
Binary file
icons/small/forrst.jpg DELETED
Binary file
icons/small/kickstarter.jpg ADDED
Binary file
icons/small/speakerdeck.jpg ADDED
Binary file
icons/small/vine.jpg ADDED
Binary file
lib/social-networks.php CHANGED
@@ -16,28 +16,33 @@
16
 
17
  global $social_accounts;
18
  $social_accounts = array(
 
19
  'About.me' => 'aboutme',
20
  'Behance' => 'behance',
 
21
  'Dribbble' => 'dribbble',
22
  'Email' => 'email',
 
23
  'Facebook' => 'facebook',
24
  'Flickr' => 'flickr',
25
- 'Forrst' => 'forrst',
26
  'Foursquare' => 'foursquare',
27
  'GitHub' => 'github',
28
  'Google+' => 'googleplus',
29
  'Instagram' => 'instagram',
 
30
  'Klout' => 'klout',
31
  'LinkedIn' => 'linkedin',
32
  'Medium' => 'medium',
33
  'Path' => 'path',
34
  'Pinterest' => 'pinterest',
35
  'RSS Feed' => 'rss',
 
36
  'StumbleUpon' => 'stumbleupon',
37
  'Technorati' => 'technorati',
38
  'Tumblr' => 'tumblr',
39
  'Twitter' => 'twitter',
40
  'Vimeo' => 'vimeo',
 
41
  'WordPress' => 'wordpress',
42
  'Yelp' => 'yelp',
43
  'YouTube' => 'youtube',
16
 
17
  global $social_accounts;
18
  $social_accounts = array(
19
+ '500px' => 'fivehundredpx',
20
  'About.me' => 'aboutme',
21
  'Behance' => 'behance',
22
+ 'Codepen' => 'codepen',
23
  'Dribbble' => 'dribbble',
24
  'Email' => 'email',
25
+ 'Envato' => 'envato',
26
  'Facebook' => 'facebook',
27
  'Flickr' => 'flickr',
 
28
  'Foursquare' => 'foursquare',
29
  'GitHub' => 'github',
30
  'Google+' => 'googleplus',
31
  'Instagram' => 'instagram',
32
+ 'Kickstarter' => 'kickstarter',
33
  'Klout' => 'klout',
34
  'LinkedIn' => 'linkedin',
35
  'Medium' => 'medium',
36
  'Path' => 'path',
37
  'Pinterest' => 'pinterest',
38
  'RSS Feed' => 'rss',
39
+ 'Speaker Deck' => 'speakerdeck',
40
  'StumbleUpon' => 'stumbleupon',
41
  'Technorati' => 'technorati',
42
  'Tumblr' => 'tumblr',
43
  'Twitter' => 'twitter',
44
  'Vimeo' => 'vimeo',
45
+ 'Vine' => 'vine',
46
  'WordPress' => 'wordpress',
47
  'Yelp' => 'yelp',
48
  'YouTube' => 'youtube',
lib/widget.php CHANGED
@@ -1,11 +1,5 @@
1
  <?php
2
  global $social_accounts;
3
-
4
- $data = array();
5
- foreach ($social_accounts as $site => $id) {
6
- $data[$id] = $instance[$id];
7
- }
8
-
9
  extract($args);
10
 
11
  $title = empty($instance['title']) ? 'Follow Us' : apply_filters('widget_title', $instance['title']);
@@ -26,10 +20,16 @@ else { $ul_class = ''; }
26
  $ul_class .= 'icons-'.$icons;
27
  ?>
28
 
29
- <ul class="<?php echo $ul_class; ?>">
 
30
  <?php foreach($social_accounts as $title => $id) : ?>
31
  <?php if($instance[$id] != '' && $instance[$id] != 'http://') :
32
 
 
 
 
 
 
33
  $custom_sizes = array('custom_small','custom_medium','custom_large');
34
 
35
  if (in_array($icons, $custom_sizes)) {
@@ -38,7 +38,11 @@ $ul_class .= 'icons-'.$icons;
38
  }
39
  else {
40
  $siw_abs_path = str_replace('lib/', '', plugin_dir_path( __FILE__ ));
41
- $icon_path = $siw_abs_path . 'icons/'.$icons.'/'.$id.'.{gif,jpg,jpeg,png}';
 
 
 
 
42
  }
43
 
44
  $result = glob( $icon_path, GLOB_BRACE );
@@ -60,17 +64,22 @@ $ul_class .= 'icons-'.$icons;
60
  $icon = '';
61
  }
62
 
63
- if ( $icon ) { $image = '<img class="site-icon" src="'.$icon.'" alt="'.$title.'" title="'.$title.'" />'; }
64
- else { $image = ''; }
65
-
66
- if($labels != 'show') { $title = ''; }
67
- else { $title = '<span class="site-label">'.$title.'</span>'; }
68
 
 
 
 
 
 
 
 
69
  ?>
70
- <li><a href="<?php echo $instance[$id]; ?>"><?php echo $image; ?><?php echo $title; ?></a></li>
71
  <?php endif; ?>
72
  <?php endforeach; ?>
73
- </ul>
 
74
 
75
  <?php
76
  echo $after_widget;
1
  <?php
2
  global $social_accounts;
 
 
 
 
 
 
3
  extract($args);
4
 
5
  $title = empty($instance['title']) ? 'Follow Us' : apply_filters('widget_title', $instance['title']);
20
  $ul_class .= 'icons-'.$icons;
21
  ?>
22
 
23
+ <?php echo apply_filters('social_icon_opening_tag', '<ul class="'.$ul_class.'">'); ?>
24
+
25
  <?php foreach($social_accounts as $title => $id) : ?>
26
  <?php if($instance[$id] != '' && $instance[$id] != 'http://') :
27
 
28
+ global $data;
29
+ global $icon_output;
30
+
31
+ $data['id'] = $id;
32
+ $data['url'] = $instance[$id];
33
  $custom_sizes = array('custom_small','custom_medium','custom_large');
34
 
35
  if (in_array($icons, $custom_sizes)) {
38
  }
39
  else {
40
  $siw_abs_path = str_replace('lib/', '', plugin_dir_path( __FILE__ ));
41
+ $icon_path = $siw_abs_path . 'icons/'.$icons.'/'.$id.'.{gif,jpg,jpeg,png}';
42
+
43
+ if($icons == 'large') { $imgsize = 'height="64" width="64"'; }
44
+ elseif($icons == 'medium') { $imgsize = 'height="32" width="32"'; }
45
+ elseif($icons == 'small') { $imgsize = 'height="16" width="16"'; }
46
  }
47
 
48
  $result = glob( $icon_path, GLOB_BRACE );
64
  $icon = '';
65
  }
66
 
67
+ if ( $icon ) { $data['image'] = '<img class="site-icon" src="'.$icon.'" alt="'.$title.'" title="'.$title.'" '.$imgsize.' />'; }
68
+ else { $data['image'] = ''; }
 
 
 
69
 
70
+ if($labels != 'show') { $data['title'] = ''; }
71
+ else { $data['title'] = '<span class="site-label">'.$title.'</span>'; }
72
+
73
+ $format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>';
74
+ $icon_output = apply_filters('social_icon_output', $format);
75
+ echo vsprintf($icon_output, $data);
76
+
77
  ?>
78
+
79
  <?php endif; ?>
80
  <?php endforeach; ?>
81
+
82
+ <?php echo apply_filters('social_icon_closing_tag', '</ul>'); ?>
83
 
84
  <?php
85
  echo $after_widget;
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Social Icons Widget ===
2
  Contributors: dannisbet
3
- Tags: social, media, widget, follow, profile, icons, About.me, Behance, Dribbble, Email, Facebook, Flickr, Forrst, FourSquare, GitHub, Google+, Instagram, Klout, LinkedIn, Medium, Path, Pinterest, RSS, StumbleUpon, Technorati, Tumblr, Twitter, Vimeo, WordPress, Yelp, YouTube, Zerply
4
  Donate link: https://github.com/dannisbet/social-icons-widget
5
  Requires at least: 3.5.1
6
  Tested up to: 3.9
7
- Stable tag: 14.05
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -14,9 +14,25 @@ Displays a list of social media website icons and a link to your profile.
14
 
15
  The Social Media Icons widget takes a simple, extendable approach to displaying links to your social media profiles in WordPress. The purpose of this plugin was to strip away the complexities I found most other plugins to have and simply display a set of basic social icons in an unordered list. There's no frills and no fanciness, making it easy to style to your website's look.
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  = Extending =
18
 
19
- By default, the Social Icons Widget provides a variety of popular social media websites. Developers can easily add more social media websites by creating a filter in the active theme's functions.php file like such:
20
 
21
  function add_new_icons($icon_list) {
22
  $icon_list['Full Website Name'] = 'full-website-id';
@@ -27,25 +43,29 @@ By default, the Social Icons Widget provides a variety of popular social media w
27
 
28
  The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. The Social Icon Widget looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds.
29
 
30
- The widget can also be branched via its [GitHub page](https://github.com/dannisbet/social-icons-widget).
31
 
32
- = Custom Icons =
33
-
34
- Custom icons are easy to add. To enable them, select "Custom" from the Icon Type dropdown in the widget settings. In the directory of your active theme, create a folder titled 'social_icons'. Within that directory, add folders titled 'small', 'medium', and 'large' for each icon size you wish to use. Add your icons in .gif, .jpg, .jpeg, or .png format, using the name of the ID in the $social_accounts array (details above).
35
-
36
- = Icons =
37
-
38
- Default icons are from the [Simple Icons](http://simpleicons.org/) set created by Dan Leech.
39
-
40
- Email envelope icon is from Cy Me at [Noun Project](http://thenounproject.com/term/envelope/24786/).
41
 
42
- == Installation ==
 
 
 
 
43
 
44
- Download the zip file and upload to your WordPress installation. Upon activation, widget is available under Appearance > Widgets. Drag the widget into your sidebar, adjust the settings, and populate the profiles you wish to show on your website.
45
 
46
- == Frequently Asked Questions ==
 
 
 
 
47
 
48
- Coming soon.
 
 
 
 
49
 
50
  == Screenshots ==
51
 
@@ -54,6 +74,12 @@ Coming soon.
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
57
  = 14.05 =
58
  * Fixed broken image links when WordPress is installed under a directory.
59
 
1
  === Social Icons Widget ===
2
  Contributors: dannisbet
3
+ Tags: social, media, widget, follow, profile, icons, 500px, About.me, Behance, Dribbble, Codepen, Email, Envato, Facebook, Flickr, FourSquare, GitHub, Google+, Instagram, Kickstarter, Klout, LinkedIn, Medium, Path, Pinterest, RSS, Speaker Deck, StumbleUpon, Technorati, Tumblr, Twitter, Vimeo, Vine, WordPress, Yelp, YouTube, Zerply
4
  Donate link: https://github.com/dannisbet/social-icons-widget
5
  Requires at least: 3.5.1
6
  Tested up to: 3.9
7
+ Stable tag: 14.07
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
14
 
15
  The Social Media Icons widget takes a simple, extendable approach to displaying links to your social media profiles in WordPress. The purpose of this plugin was to strip away the complexities I found most other plugins to have and simply display a set of basic social icons in an unordered list. There's no frills and no fanciness, making it easy to style to your website's look.
16
 
17
+ = Custom Icons =
18
+
19
+ Custom icons are easy to add. To enable them, select "Custom" from the Icon Type dropdown in the widget settings. In the directory of your active theme, create a folder titled 'social_icons'. Within that directory, add folders titled 'small', 'medium', and 'large' for each icon size you wish to use. Add your icons in .gif, .jpg, .jpeg, or .png format, using the name of the ID in the $social_accounts array (details above).
20
+
21
+ = Icons =
22
+
23
+ Default icons are from the [Simple Icons](http://simpleicons.org/) set created by Dan Leech.
24
+
25
+ Email envelope icon is from Cy Me at [Noun Project](http://thenounproject.com/term/envelope/24786/).
26
+
27
+ == Installation ==
28
+
29
+ Download the zip file and upload to your WordPress installation. Upon activation, widget is available under Appearance > Widgets. Drag the widget into your sidebar, adjust the settings, and populate the profiles you wish to show on your website.
30
+
31
+ == Frequently Asked Questions ==
32
+
33
  = Extending =
34
 
35
+ Developers can easily add more social media websites by creating a filter in the active theme's functions.php file like such:
36
 
37
  function add_new_icons($icon_list) {
38
  $icon_list['Full Website Name'] = 'full-website-id';
43
 
44
  The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. The Social Icon Widget looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds.
45
 
46
+ = Altering Widget Output =
47
 
48
+ Output of each icon can be adjusted with the social_icon_output filter:
 
 
 
 
 
 
 
 
49
 
50
+ function social_icons_html_output($format) {
51
+ $format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>';
52
+ return $format;
53
+ }
54
+ add_filter('social_icon_output', 'social_icons_html_output');
55
 
56
+ The opening and closing unordered list tags can be edited or changed with the social_icon_opening_tag and social_icon_closing_tag filters:
57
 
58
+ function social_icon_opening_tag($opening) {
59
+ $opening = '<ul class="'.$ul_class.'">';
60
+ return $opening;
61
+ }
62
+ add_filter('social_icon_output', 'social_icons_html_output');
63
 
64
+ function social_icons_html_output($closing) {
65
+ $closing = '</ul>';
66
+ return $closing;
67
+ }
68
+ add_filter('social_icon_output', 'social_icons_html_output');
69
 
70
  == Screenshots ==
71
 
74
 
75
  == Changelog ==
76
 
77
+ = 14.07 =
78
+ * Added 500px, Codepen, Envato, Kickstarter, Speaker Deck, Vine
79
+ * Removed Forrst
80
+ * Added ability to filter opening, closing tags and HTML for icon output.
81
+ * Added target="_blank" for links to open in a new window by default.
82
+
83
  = 14.05 =
84
  * Fixed broken image links when WordPress is installed under a directory.
85
 
social-media-icons-widget.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Social Icons Widget
4
  Plugin URI: http://github.com/dannisbet/Social-Icons-Widget
5
- Version: 14.05
6
  Description: Displays a list of social media website icons and a link to your profile.
7
  Author: Dan Nisbet
8
  Author URI: http://nisbetcreative.com/
2
  /*
3
  Plugin Name: Social Icons Widget
4
  Plugin URI: http://github.com/dannisbet/Social-Icons-Widget
5
+ Version: 14.07
6
  Description: Displays a list of social media website icons and a link to your profile.
7
  Author: Dan Nisbet
8
  Author URI: http://nisbetcreative.com/