Social Icons Widget - Version 14.05

Version Description

  • Fixed broken image links when WordPress is installed under a directory.
Download this release

Release Info

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

Code changes from version 13.05 to 14.05

Files changed (90) hide show
  1. css/social_icons_admin.css +38 -1
  2. css/social_icons_widget.css +1 -0
  3. icons/large/_unknown.jpg +0 -0
  4. icons/large/aboutme.jpg +0 -0
  5. icons/large/behance.jpg +0 -0
  6. icons/large/dribbble.jpg +0 -0
  7. icons/large/email.jpg +0 -0
  8. icons/large/facebook.jpg +0 -0
  9. icons/large/facebook.png +0 -0
  10. icons/large/flickr.jpg +0 -0
  11. icons/large/forrst.jpg +0 -0
  12. icons/large/foursquare.jpg +0 -0
  13. icons/large/github.jpg +0 -0
  14. icons/large/googleplus.jpg +0 -0
  15. icons/large/instagram.jpg +0 -0
  16. icons/large/klout.jpg +0 -0
  17. icons/large/linkedin.jpg +0 -0
  18. icons/large/medium.jpg +0 -0
  19. icons/large/path.jpg +0 -0
  20. icons/large/pinterest.jpg +0 -0
  21. icons/large/rss.jpg +0 -0
  22. icons/large/stumbleupon.jpg +0 -0
  23. icons/large/tumblr.jpg +0 -0
  24. icons/large/twitter.jpg +0 -0
  25. icons/large/vimeo.jpg +0 -0
  26. icons/large/wordpress.jpg +0 -0
  27. icons/large/yelp.jpg +0 -0
  28. icons/large/youtube.jpg +0 -0
  29. icons/large/zerply.jpg +0 -0
  30. icons/medium/_unknown.jpg +0 -0
  31. icons/medium/aboutme.jpg +0 -0
  32. icons/medium/behance.jpg +0 -0
  33. icons/medium/dribbble.jpg +0 -0
  34. icons/medium/email.jpg +0 -0
  35. icons/medium/facebook.jpg +0 -0
  36. icons/medium/facebook.png +0 -0
  37. icons/medium/flickr.jpg +0 -0
  38. icons/medium/forrst.jpg +0 -0
  39. icons/medium/foursquare.jpg +0 -0
  40. icons/medium/github.jpg +0 -0
  41. icons/medium/googleplus.jpg +0 -0
  42. icons/medium/instagram.jpg +0 -0
  43. icons/medium/klout.jpg +0 -0
  44. icons/medium/linkedin.jpg +0 -0
  45. icons/medium/medium.jpg +0 -0
  46. icons/medium/path.jpg +0 -0
  47. icons/medium/pinterest.jpg +0 -0
  48. icons/medium/rss.jpg +0 -0
  49. icons/medium/stumbleupon.jpg +0 -0
  50. icons/medium/technorati.jpg +0 -0
  51. icons/medium/tumblr.jpg +0 -0
  52. icons/medium/twitter.jpg +0 -0
  53. icons/medium/vimeo.jpg +0 -0
  54. icons/medium/wordpress.jpg +0 -0
  55. icons/medium/yelp.jpg +0 -0
  56. icons/medium/youtube.jpg +0 -0
  57. icons/medium/zerply.jpg +0 -0
  58. icons/small/_unknown.jpg +0 -0
  59. icons/small/aboutme.jpg +0 -0
  60. icons/small/behance.jpg +0 -0
  61. icons/small/dribbble.jpg +0 -0
  62. icons/small/email.jpg +0 -0
  63. icons/small/facebook.jpg +0 -0
  64. icons/small/facebook.png +0 -0
  65. icons/small/flickr.jpg +0 -0
  66. icons/small/forrst.jpg +0 -0
  67. icons/small/foursquare.jpg +0 -0
  68. icons/small/github.jpg +0 -0
  69. icons/small/googleplus.jpg +0 -0
  70. icons/small/instagram.jpg +0 -0
  71. icons/small/klout.jpg +0 -0
  72. icons/small/linkedin.jpg +0 -0
  73. icons/small/medium.jpg +0 -0
  74. icons/small/path.jpg +0 -0
  75. icons/small/pinterest.jpg +0 -0
  76. icons/small/rss.jpg +0 -0
  77. icons/small/stumbleupon.jpg +0 -0
  78. icons/small/technorati.jpg +0 -0
  79. icons/small/tumblr.jpg +0 -0
  80. icons/small/twitter.jpg +0 -0
  81. icons/small/vimeo.jpg +0 -0
  82. icons/small/wordpress.jpg +0 -0
  83. icons/small/yelp.jpg +0 -0
  84. icons/small/youtube.jpg +0 -0
  85. icons/small/zerply.jpg +0 -0
  86. lib/form.php +10 -10
  87. lib/social-networks.php +48 -25
  88. lib/widget.php +24 -11
  89. readme.txt +28 -13
  90. social-media-icons-widget.php +3 -2
css/social_icons_admin.css CHANGED
@@ -9,6 +9,39 @@
9
  margin-bottom:5px;
10
  }
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  .social_icons_widget .icon_options label,
13
  .social_icons_widget .label_options label {
14
  display:inline;
@@ -17,6 +50,7 @@
17
 
18
  .widget .widget-inside .icon_options,
19
  .widget .widget-inside .label_options {
 
20
  padding:0 1.5%;
21
  width:47%;
22
  }
@@ -27,7 +61,10 @@
27
  .social_icons_widget .social_accounts {
28
  border-top:1px #ccc solid;
29
  clear:both;
30
- padding-top:15px;
 
 
 
31
  }
32
 
33
  .social_icons_widget .social_accounts li {
9
  margin-bottom:5px;
10
  }
11
 
12
+ .social_icons_widget .social_accounts label {
13
+ background-repeat:no-repeat;
14
+ padding-left:20px;
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'); }
43
+ .social_icons_widget .zerply { background-image:url('../icons/small/zerply.jpg'); }
44
+
45
  .social_icons_widget .icon_options label,
46
  .social_icons_widget .label_options label {
47
  display:inline;
50
 
51
  .widget .widget-inside .icon_options,
52
  .widget .widget-inside .label_options {
53
+ margin:0;
54
  padding:0 1.5%;
55
  width:47%;
56
  }
61
  .social_icons_widget .social_accounts {
62
  border-top:1px #ccc solid;
63
  clear:both;
64
+ float:left;
65
+ margin-top:1.5em;
66
+ padding-top:1.5em;
67
+ width:100%;
68
  }
69
 
70
  .social_icons_widget .social_accounts li {
css/social_icons_widget.css CHANGED
@@ -19,6 +19,7 @@
19
  }
20
 
21
  .social-icons-widget ul.show-labels li img {
 
22
  margin-right:10px;
23
  vertical-align:middle;
24
  }
19
  }
20
 
21
  .social-icons-widget ul.show-labels li img {
22
+ float:left;
23
  margin-right:10px;
24
  vertical-align:middle;
25
  }
icons/large/_unknown.jpg ADDED
Binary file
icons/large/aboutme.jpg ADDED
Binary file
icons/large/behance.jpg CHANGED
Binary file
icons/large/dribbble.jpg CHANGED
Binary file
icons/large/email.jpg ADDED
Binary file
icons/large/facebook.jpg ADDED
Binary file
icons/large/facebook.png DELETED
Binary file
icons/large/flickr.jpg CHANGED
Binary file
icons/large/forrst.jpg CHANGED
Binary file
icons/large/foursquare.jpg CHANGED
Binary file
icons/large/github.jpg ADDED
Binary file
icons/large/googleplus.jpg CHANGED
Binary file
icons/large/instagram.jpg CHANGED
Binary file
icons/large/klout.jpg CHANGED
Binary file
icons/large/linkedin.jpg CHANGED
Binary file
icons/large/medium.jpg ADDED
Binary file
icons/large/path.jpg CHANGED
Binary file
icons/large/pinterest.jpg CHANGED
Binary file
icons/large/rss.jpg CHANGED
Binary file
icons/large/stumbleupon.jpg CHANGED
Binary file
icons/large/tumblr.jpg CHANGED
Binary file
icons/large/twitter.jpg CHANGED
Binary file
icons/large/vimeo.jpg CHANGED
Binary file
icons/large/wordpress.jpg ADDED
Binary file
icons/large/yelp.jpg CHANGED
Binary file
icons/large/youtube.jpg CHANGED
Binary file
icons/large/zerply.jpg CHANGED
Binary file
icons/medium/_unknown.jpg ADDED
Binary file
icons/medium/aboutme.jpg ADDED
Binary file
icons/medium/behance.jpg CHANGED
Binary file
icons/medium/dribbble.jpg CHANGED
Binary file
icons/medium/email.jpg ADDED
Binary file
icons/medium/facebook.jpg ADDED
Binary file
icons/medium/facebook.png DELETED
Binary file
icons/medium/flickr.jpg CHANGED
Binary file
icons/medium/forrst.jpg CHANGED
Binary file
icons/medium/foursquare.jpg CHANGED
Binary file
icons/medium/github.jpg ADDED
Binary file
icons/medium/googleplus.jpg CHANGED
Binary file
icons/medium/instagram.jpg CHANGED
Binary file
icons/medium/klout.jpg CHANGED
Binary file
icons/medium/linkedin.jpg CHANGED
Binary file
icons/medium/medium.jpg ADDED
Binary file
icons/medium/path.jpg CHANGED
Binary file
icons/medium/pinterest.jpg CHANGED
Binary file
icons/medium/rss.jpg CHANGED
Binary file
icons/medium/stumbleupon.jpg CHANGED
Binary file
icons/medium/technorati.jpg CHANGED
Binary file
icons/medium/tumblr.jpg CHANGED
Binary file
icons/medium/twitter.jpg CHANGED
Binary file
icons/medium/vimeo.jpg CHANGED
Binary file
icons/medium/wordpress.jpg ADDED
Binary file
icons/medium/yelp.jpg CHANGED
Binary file
icons/medium/youtube.jpg CHANGED
Binary file
icons/medium/zerply.jpg CHANGED
Binary file
icons/small/_unknown.jpg ADDED
Binary file
icons/small/aboutme.jpg ADDED
Binary file
icons/small/behance.jpg CHANGED
Binary file
icons/small/dribbble.jpg CHANGED
Binary file
icons/small/email.jpg ADDED
Binary file
icons/small/facebook.jpg ADDED
Binary file
icons/small/facebook.png DELETED
Binary file
icons/small/flickr.jpg CHANGED
Binary file
icons/small/forrst.jpg CHANGED
Binary file
icons/small/foursquare.jpg CHANGED
Binary file
icons/small/github.jpg ADDED
Binary file
icons/small/googleplus.jpg CHANGED
Binary file
icons/small/instagram.jpg CHANGED
Binary file
icons/small/klout.jpg CHANGED
Binary file
icons/small/linkedin.jpg CHANGED
Binary file
icons/small/medium.jpg ADDED
Binary file
icons/small/path.jpg CHANGED
Binary file
icons/small/pinterest.jpg CHANGED
Binary file
icons/small/rss.jpg CHANGED
Binary file
icons/small/stumbleupon.jpg CHANGED
Binary file
icons/small/technorati.jpg CHANGED
Binary file
icons/small/tumblr.jpg CHANGED
Binary file
icons/small/twitter.jpg CHANGED
Binary file
icons/small/vimeo.jpg CHANGED
Binary file
icons/small/wordpress.jpg ADDED
Binary file
icons/small/yelp.jpg CHANGED
Binary file
icons/small/youtube.jpg CHANGED
Binary file
icons/small/zerply.jpg CHANGED
Binary file
lib/form.php CHANGED
@@ -11,13 +11,14 @@ foreach ($social_accounts as $site => $id) {
11
  $data['title'] = $instance['title'];
12
  $data['icons'] = $instance['icons'];
13
  $data['labels'] = $instance['labels'];
 
14
 
15
  ?>
16
 
17
  <div class="social_icons_widget">
18
 
19
  <p><label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
20
- <input class="widefat" type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo attribute_escape($data['title']); ?>" /></p>
21
 
22
  <?php
23
  $sizes = array(
@@ -36,7 +37,7 @@ $sizes = array(
36
  <?php
37
  foreach($sizes as $option => $value) :
38
 
39
- if(attribute_escape($data['icons'] == $value)) { $selected = ' selected="selected"'; }
40
  else { $selected = ''; }
41
  ?>
42
 
@@ -46,17 +47,16 @@ $sizes = array(
46
  </select>
47
  </p>
48
 
49
- <?php if(attribute_escape($data['labels'] == 'show')) { $checked = ' checked="checked"'; } ?>
50
  <p class="label_options"><input type="checkbox" id="<?php echo $this->get_field_id('labels'); ?>" name="<?php echo $this->get_field_name('labels'); ?>" value="show"<?php echo $checked; ?> /> <label for="<?php echo $this->get_field_id('labels'); ?>">Show Labels</label></p>
51
 
 
 
 
52
  <ul class="social_accounts">
53
- <?php foreach ($social_accounts as $site => $id) :
54
- $icon = plugins_url('social-media-icons-widget/icons/small/'.$id.'.jpg', '');
55
- if ( @getimagesize($icon) ) { $image = '<img class="site_icon" src="'.$icon.'" alt="'.$site.'" height="16" width="16" />'; }
56
- else { $image = ''; }
57
- ?>
58
- <li><?php echo $image; ?> <label for="<?php echo $this->get_field_id($id); ?>"><?php echo $site; ?>:</label>
59
- <input class="widefat" type="text" id="<?php echo $this->get_field_id($id); ?>" name="<?php echo $this->get_field_name($id); ?>" value="<?php echo attribute_escape($data[$id]); ?>" /></li>
60
  <?php endforeach; ?>
61
  </ul>
62
 
11
  $data['title'] = $instance['title'];
12
  $data['icons'] = $instance['icons'];
13
  $data['labels'] = $instance['labels'];
14
+ $data['show_title'] = $instance['show_title'];
15
 
16
  ?>
17
 
18
  <div class="social_icons_widget">
19
 
20
  <p><label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
21
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($data['title']); ?>" /></p>
22
 
23
  <?php
24
  $sizes = array(
37
  <?php
38
  foreach($sizes as $option => $value) :
39
 
40
+ if(esc_attr($data['icons'] == $value)) { $selected = ' selected="selected"'; }
41
  else { $selected = ''; }
42
  ?>
43
 
47
  </select>
48
  </p>
49
 
50
+ <?php if(esc_attr($data['labels'] == 'show')) { $checked = ' checked="checked"'; } else { $checked = ''; } ?>
51
  <p class="label_options"><input type="checkbox" id="<?php echo $this->get_field_id('labels'); ?>" name="<?php echo $this->get_field_name('labels'); ?>" value="show"<?php echo $checked; ?> /> <label for="<?php echo $this->get_field_id('labels'); ?>">Show Labels</label></p>
52
 
53
+ <?php if(esc_attr($data['show_title'] == 'show')) { $checked = ' checked="checked"'; } else { $checked = ''; } ?>
54
+ <p class="label_options"><input type="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="show"<?php echo $checked; ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?>">Hide Title</label></p>
55
+
56
  <ul class="social_accounts">
57
+ <?php foreach ($social_accounts as $site => $id) : ?>
58
+ <li><label for="<?php echo $this->get_field_id($id); ?>" class="<?php echo $id; ?>"><?php echo $site; ?>:</label>
59
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id($id); ?>" name="<?php echo $this->get_field_name($id); ?>" value="<?php echo esc_attr($data[$id]); ?>" /></li>
 
 
 
 
60
  <?php endforeach; ?>
61
  </ul>
62
 
lib/social-networks.php CHANGED
@@ -1,27 +1,50 @@
1
  <?php
2
- // Declare supported social media websites
3
- global $social_accounts;
4
- $social_accounts = array(
5
- 'Behance' => 'behance',
6
- 'Dribbble' => 'dribbble',
7
- 'Facebook' => 'facebook',
8
- 'Flickr' => 'flickr',
9
- 'Forrst' => 'forrst',
10
- 'Foursquare' => 'foursquare',
11
- 'Google+' => 'googleplus',
12
- 'Instagram' => 'instagram',
13
- 'Klout' => 'klout',
14
- 'LinkedIn' => 'linkedin',
15
- 'Path' => 'path',
16
- 'Pinterest' => 'pinterest',
17
- 'RSS Feed' => 'rss',
18
- 'StumbleUpon' => 'stumbleupon',
19
- 'Technorati' => 'technorati',
20
- 'Tumblr' => 'tumblr',
21
- 'Twitter' => 'twitter',
22
- 'Vimeo' => 'vimeo',
23
- 'Yelp' => 'yelp',
24
- 'YouTube' => 'youtube',
25
- 'Zerply' => 'zerply'
26
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ?>
1
  <?php
2
+ /*
3
+ Declare supported social media websites
4
+
5
+ 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:
6
+
7
+ `function add_new_icons($icon_list) {
8
+ $icon_list['Full Website Name'] = 'full-website-id';
9
+
10
+ return $icon_list;
11
+ }
12
+ add_filter('social_icon_accounts', 'add_new_icons');`
13
+
14
+ 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.
15
+ */
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',
44
+ 'Zerply' => 'zerply'
45
+ );
46
+
47
+ if( has_filter('social_icon_accounts') ) {
48
+ $social_accounts = apply_filters('social_icon_accounts', $social_accounts);
49
+ }
50
  ?>
lib/widget.php CHANGED
@@ -8,17 +8,21 @@ foreach ($social_accounts as $site => $id) {
8
 
9
  extract($args);
10
 
11
- $title = $instance['title'];
12
  $icons = $instance['icons'];
13
  $labels = $instance['labels'];
 
14
 
15
  echo $before_widget;
16
 
17
- echo $before_title;
18
- echo $title;
19
- echo $after_title;
 
 
20
 
21
  if($labels == 'show') { $ul_class = 'show-labels '; }
 
22
  $ul_class .= 'icons-'.$icons;
23
  ?>
24
 
@@ -33,21 +37,30 @@ $ul_class .= 'icons-'.$icons;
33
  $icon_path = STYLESHEETPATH .'/social_icons/'.$size.'/'.$id.'.{gif,jpg,jpeg,png}';
34
  }
35
  else {
36
- $icon_path = ABSPATH .'wp-content/plugins/social-media-icons-widget/icons/'.$icons.'/'.$id.'.{gif,jpg,jpeg,png}';
 
37
  }
38
 
39
  $result = glob( $icon_path, GLOB_BRACE );
40
 
41
- if (in_array($icons, $custom_sizes)) {
42
- $path = explode('themes', $result[0]);
43
- $icon = get_bloginfo('url').'/wp-content/themes'.$path[1];
 
 
 
 
 
 
 
 
 
44
  }
45
  else {
46
- $path = explode('plugins', $result[0]);
47
- $icon = get_bloginfo('url').'/wp-content/plugins'.$path[1];
48
  }
49
 
50
- if ( @getimagesize($icon) ) { $image = '<img class="site-icon" src="'.$icon.'" alt="'.$title.'" title="'.$title.'" />'; }
51
  else { $image = ''; }
52
 
53
  if($labels != 'show') { $title = ''; }
8
 
9
  extract($args);
10
 
11
+ $title = empty($instance['title']) ? 'Follow Us' : apply_filters('widget_title', $instance['title']);
12
  $icons = $instance['icons'];
13
  $labels = $instance['labels'];
14
+ $show_title = $instance['show_title'];
15
 
16
  echo $before_widget;
17
 
18
+ if($show_title == '') {
19
+ echo $before_title;
20
+ echo $title;
21
+ echo $after_title;
22
+ }
23
 
24
  if($labels == 'show') { $ul_class = 'show-labels '; }
25
+ else { $ul_class = ''; }
26
  $ul_class .= 'icons-'.$icons;
27
  ?>
28
 
37
  $icon_path = STYLESHEETPATH .'/social_icons/'.$size.'/'.$id.'.{gif,jpg,jpeg,png}';
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 );
45
 
46
+ if($result) {
47
+ if (in_array($icons, $custom_sizes)) {
48
+ $path = explode('themes', $result[0]);
49
+ $icon = get_bloginfo('url').'/wp-content/themes'.$path[1];
50
+ }
51
+ else {
52
+ $path = explode('plugins', $result[0]);
53
+ $icon = plugins_url().''.$path[1];
54
+ }
55
+ }
56
+ elseif( $labels != 'show' && $icons != 'small' ) {
57
+ $icon = plugins_url().'/social-media-icons-widget/icons/'.$icons.'/_unknown.jpg';
58
  }
59
  else {
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 = ''; }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Social Icons Widget ===
2
  Contributors: dannisbet
3
- Tags: social, media, widget, follow, profile, icons, twitter, facebook, linkedin, forrst, dribbble
4
- Donate link: http://dannisbet.com/
5
  Requires at least: 3.5.1
6
- Tested up to: 3.6-beta2
7
- Stable tag: 2013.05
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -16,15 +16,14 @@ The Social Media Icons widget takes a simple, extendable approach to displaying
16
 
17
  = Extending =
18
 
19
- Developers can easily extend the plugin to accept additional website profiles and upload custom icons to replace the default set. The widget settings allow for three different sizes by default and users can choose to display a label next to each icon.
20
 
21
- By default, the Social Icons Widget provides a variety of popular social media websites. However, it's been structured to allow for easy addition of new social media profiles, or removal of unwanted ones.
22
-
23
- To edit the list of social media profiles, open social-media-icons-widget.php and locate line 32, which contains the $social_accounts array. Any edits made to this array will be reflected through the entire widget. There's no need to find/replace in any other file.
24
-
25
- The structure of the array follows a simple format:
26
-
27
- 'Full Website Name' => 'full-website-id'
28
 
29
  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.
30
 
@@ -36,7 +35,9 @@ Custom icons are easy to add. To enable them, select "Custom" from the Icon Type
36
 
37
  = Icons =
38
 
39
- Default icons are from the Social Boilerplate Iconset created by [Mosaic Web Studios](http://mosaic.ws/projects/boilerplate.php).
 
 
40
 
41
  == Installation ==
42
 
@@ -53,6 +54,17 @@ Coming soon.
53
 
54
  == Changelog ==
55
 
 
 
 
 
 
 
 
 
 
 
 
56
  = 2013.05 =
57
  * Fixed image and CSS paths
58
 
@@ -64,6 +76,9 @@ Coming soon.
64
 
65
  == Upgrade Notice ==
66
 
 
 
 
67
  = 2013.05 =
68
  Fixed image and CSS paths
69
 
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
 
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';
23
+
24
+ return $icon_list;
25
+ }
26
+ add_filter('social_icon_accounts', 'add_new_icons');
 
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
 
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
 
54
 
55
  == Changelog ==
56
 
57
+ = 14.05 =
58
+ * Fixed broken image links when WordPress is installed under a directory.
59
+
60
+ = 14.04 =
61
+ * Added new options for About.me, Email, GitHub, Medium, and WordPress profile links
62
+ * Updated all icons to Simple Icons set
63
+
64
+ = 14.03 =
65
+ * Removed @getimagesize function for compatibility purposes
66
+ * New accounts are now added via WordPress filter rather than editing core plugin code
67
+
68
  = 2013.05 =
69
  * Fixed image and CSS paths
70
 
76
 
77
  == Upgrade Notice ==
78
 
79
+ = 14.03 =
80
+ Removed @getimagesize function for compatibility purposes. New accounts are now added via WordPress filter rather than editing core plugin code.
81
+
82
  = 2013.05 =
83
  Fixed image and CSS paths
84
 
social-media-icons-widget.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: Social Icons Widget
4
  Plugin URI: http://github.com/dannisbet/Social-Icons-Widget
5
- Version: 2013.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://dannisbet.com/
9
  */
10
 
11
  class Social_Icons_Widget extends WP_Widget {
@@ -45,6 +45,7 @@ class Social_Icons_Widget extends WP_Widget {
45
  $instance['title'] = $new_instance['title'];
46
  $instance['icons'] = $new_instance['icons'];
47
  $instance['labels'] = $new_instance['labels'];
 
48
 
49
  return $instance;
50
  }
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/
9
  */
10
 
11
  class Social_Icons_Widget extends WP_Widget {
45
  $instance['title'] = $new_instance['title'];
46
  $instance['icons'] = $new_instance['icons'];
47
  $instance['labels'] = $new_instance['labels'];
48
+ $instance['show_title'] = $new_instance['show_title'];
49
 
50
  return $instance;
51
  }