Simple Social Icons - Version 0.9.1

Version Description

  • Fixed some styling issues
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Simple Social Icons
Version 0.9.1
Comparing to
See all releases

Code changes from version 1.0.9 to 0.9.1

css/style.css DELETED
@@ -1,67 +0,0 @@
1
- @font-face {
2
- font-family: 'fontello';
3
- src: url('../font/fontello.eot?78492063');
4
- src: url('../font/fontello.eot?78492063#iefix') format('embedded-opentype'),
5
- url('../font/fontello.woff?78492063') format('woff'),
6
- url('../font/fontello.ttf?78492063') format('truetype'),
7
- url('../font/fontello.svg?78492063#fontello') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
- /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
12
- /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
13
- /*
14
- @media screen and (-webkit-min-device-pixel-ratio:0) {
15
- @font-face {
16
- font-family: 'fontello';
17
- src: url('../font/fontello.svg?11995952#fontello') format('svg');
18
- }
19
- }
20
- */
21
-
22
- .simple-social-icons {
23
- overflow: hidden;
24
- }
25
-
26
- .simple-social-icons ul {
27
- margin: 0;
28
- padding: 0;
29
- }
30
-
31
- .simple-social-icons ul li {
32
- background: none !important;
33
- border: none !important;
34
- float: left;
35
- list-style-type: none !important;
36
- margin: 0 6px 12px !important;
37
- padding: 0 !important;
38
- }
39
-
40
- .simple-social-icons ul li a {
41
- border: none !important;
42
- -moz-box-sizing: content-box;
43
- -webkit-box-sizing: content-box;
44
- box-sizing: content-box;
45
- display: inline-block;
46
- font-family: 'fontello';
47
- font-style: normal !important;
48
- font-variant: normal !important;
49
- font-weight: normal !important;
50
- line-height: 1em;
51
- speak: none;
52
- text-align: center;
53
- text-decoration: none !important;
54
- text-transform: none !important;
55
- width: 1em;
56
- -webkit-font-smoothing: antialiased;
57
- -moz-osx-font-smoothing: grayscale;
58
- }
59
-
60
- .simple-social-icons ul.aligncenter {
61
- text-align: center;
62
- }
63
-
64
- .simple-social-icons ul.aligncenter li {
65
- display: inline-block;
66
- float: none;
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
font/LICENSE.txt DELETED
@@ -1,25 +0,0 @@
1
- Font license info
2
-
3
-
4
- ## Entypo
5
-
6
- Copyright (C) 2012 by Daniel Bruce
7
-
8
- Author: Daniel Bruce
9
- License: SIL (http://scripts.sil.org/OFL)
10
- Homepage: http://www.entypo.com
11
-
12
-
13
- ## Web Symbols
14
-
15
- Copyright (c) 2011 by Just Be Nice studio. All rights reserved.
16
-
17
- Author: Just Be Nice studio
18
- License: SIL (http://scripts.sil.org/OFL)
19
- Homepage: http://www.justbenicestudio.com/studio/websymbols/
20
-
21
-
22
- ## Social Extention
23
-
24
- The rights to each pictogram in the social extention are either trademarked or copyrighted by the respective company.
25
- Icons that are included in the social extention can be identified at http://www.entypo.com/.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
font/config.json DELETED
@@ -1,106 +0,0 @@
1
- {
2
- "name": "",
3
- "css_prefix_text": "icon-",
4
- "css_use_suffix": false,
5
- "hinting": true,
6
- "units_per_em": 1000,
7
- "ascent": 850,
8
- "glyphs": [
9
- {
10
- "uid": "a9862b9d5197886c1ad693ecd7120b31",
11
- "css": "youtube",
12
- "code": 59396,
13
- "src": "fontawesome"
14
- },
15
- {
16
- "uid": "e335adbc2d898c7d85d40c507796e7b4",
17
- "css": "mail",
18
- "code": 59403,
19
- "src": "entypo"
20
- },
21
- {
22
- "uid": "0eabe5f8d71cc838484ff39436426d2d",
23
- "css": "heart",
24
- "code": 59407,
25
- "src": "entypo"
26
- },
27
- {
28
- "uid": "3e617d8049807e128c80d0344ba09e37",
29
- "css": "rss",
30
- "code": 59397,
31
- "src": "entypo"
32
- },
33
- {
34
- "uid": "d94334f23acba022bfd68e49d76b31bb",
35
- "css": "github",
36
- "code": 59404,
37
- "src": "entypo"
38
- },
39
- {
40
- "uid": "14cfd18cc1dd5fb99ba04311b888bc23",
41
- "css": "flickr",
42
- "code": 59402,
43
- "src": "entypo"
44
- },
45
- {
46
- "uid": "538531af0e023b15882c505ee2297cbe",
47
- "css": "vimeo",
48
- "code": 59406,
49
- "src": "entypo"
50
- },
51
- {
52
- "uid": "d090355c31f497b61d676416c1fd39fb",
53
- "css": "twitter",
54
- "code": 59405,
55
- "src": "entypo"
56
- },
57
- {
58
- "uid": "bc50457410acf467b8b5721240768742",
59
- "css": "facebook",
60
- "code": 59394,
61
- "src": "entypo"
62
- },
63
- {
64
- "uid": "b945f4ac2439565661e8e4878e35d379",
65
- "css": "gplus",
66
- "code": 59393,
67
- "src": "entypo"
68
- },
69
- {
70
- "uid": "689febe699d74bc8862965555503e445",
71
- "css": "pinterest",
72
- "code": 59395,
73
- "src": "entypo"
74
- },
75
- {
76
- "uid": "d491462e64eb5b8c4f064108a2ff1780",
77
- "css": "tumblr",
78
- "code": 59399,
79
- "src": "entypo"
80
- },
81
- {
82
- "uid": "7132e1233bc16cd1b6efe7e29d3613a5",
83
- "css": "linkedin",
84
- "code": 59398,
85
- "src": "entypo"
86
- },
87
- {
88
- "uid": "e8d13cd05bd63219329b2b61835d776c",
89
- "css": "dribbble",
90
- "code": 59392,
91
- "src": "entypo"
92
- },
93
- {
94
- "uid": "ef5e2b339a93fff038cc6a28f8c91edd",
95
- "css": "stumbleupon",
96
- "code": 59400,
97
- "src": "entypo"
98
- },
99
- {
100
- "uid": "0fbfb1cd7a847c88ea4c141d0e1bbdb5",
101
- "css": "instagram",
102
- "code": 59401,
103
- "src": "entypo"
104
- }
105
- ]
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
font/fontello.eot DELETED
Binary file
font/fontello.svg DELETED
@@ -1,27 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="fontello" horiz-adv-x="1000" >
7
- <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="dribbble" unicode="&#xe800;" d="m438 480q-30 54-66 109t-56 84-24 33q-82-40-139-112t-77-162q182 0 362 48z m50-132q8 4 14 4-10 28-32 68-182-56-402-56l0-14q0-150 100-262 4 8 13 21t39 50 64 69 89 66 115 54z m-270-306q-2 0-4 2l-4 4z m148 690z m354-86q-114 98-260 98-48 0-92-12 82-108 146-228 138 52 204 140z m-260-756q-190 0-325 135t-135 325 135 325 325 135 325-135 135-325-135-325-325-135z m68 396q-216-74-308-242l-2-2q110-84 242-84 78 0 154 32-24 140-84 298z m16 158q12-24 26-56 2-2 5-9t5-11q66 8 129 4t101-10 42-8q0 138-88 246l-8-10q-8-10-26-27t-42-36-62-42-82-41z m60-138q52-148 76-280 140 92 168 262-8 4-39 11t-88 12-117-5z" horiz-adv-x="920" />
10
- <glyph glyph-name="gplus" unicode="&#xe801;" d="m48 572q0 58 25 102t56 65 69 34 56 15 26 2l230 0 0-4q0-22-78-36-28 0-38-6 40-20 54-56t14-96q0-102-68-158-38-38-38-54 0-18 50-64 104-90 104-178 0-140-116-194-68-34-150-34l-4 0-4 2q-2-2-4-2-24 0-54 5t-75 21-74 57-29 103q0 60 32 101t83 57 88 22 71 6l2 0q-16 22-24 47t-8 39l2 14-14 0q-64 0-110 30-74 44-74 160z m370-452q-4 52-43 84t-103 32l-16 0q-64-2-114-46-46-42-42-94t53-80 119-24q68 4 109 40t37 88z m-60 500q-30 108-122 108-12 0-20-2-40-12-58-62-16-50-2-106 14-52 47-85t71-33q12 0 18 2 42 12 63 65t3 113z m388-174l150 0 0-94-150 0 0-150-94 0 0 150-150 0 0 94 150 0 0 150 94 0 0-150z" horiz-adv-x="896" />
11
- <glyph glyph-name="facebook" unicode="&#xe802;" d="m500 644l-142 0q-14 0-25-15t-11-37l0-102 178 0 0-148-178 0 0-442-170 0 0 442-152 0 0 148 152 0 0 86q0 94 59 159t147 65l142 0 0-156z" horiz-adv-x="500" />
12
- <glyph glyph-name="pinterest" unicode="&#xe803;" d="m320 190q-26-130-58-211t-96-129q-6 74-7 120t11 110 22 104 26 99 24 99q-24 52-19 116t48 106 99 20q40-16 44-59t-13-95-32-103-4-90 63-49q68-14 121 38t74 131 11 163-54 128q-62 64-151 70t-163-33-120-117-32-170q4-22 22-52t21-47-17-67q-146 34-140 230 4 138 105 234t233 112q164 18 290-57t144-219q26-176-66-317t-252-129q-22 2-42 9t-30 13-31 21-31 21z" horiz-adv-x="778" />
13
- <glyph glyph-name="youtube" unicode="&#xe804;" d="m542 156v-118q0-37-22-37-13 0-25 12v168q12 12 25 12 22 0 22-37z m188-1v-25h-50v25q0 38 25 38t25-38z m-539 122h60v52h-174v-52h59v-318h55v318z m161-318h50v276h-50v-211q-17-23-32-23-10 0-11 11-1 2-1 20v203h-50v-218q0-28 5-41 7-21 32-21 27 0 57 34v-30z m240 83v110q0 41-5 55-10 31-40 31-28 0-52-30v121h-50v-370h50v27q25-31 52-31 30 0 40 31 5 15 5 56z m188 6v7h-51q0-29-1-34-4-20-22-20-26 0-26 38v49h100v57q0 44-15 65-22 28-59 28-38 0-60-28-15-21-15-65v-96q0-44 16-65 22-29 60-29 40 0 60 30 10 15 12 30 1 5 1 33z m-339 509v117q0 39-24 39t-24-39v-117q0-39 24-39t24 39z m401-419q0-131-14-195-8-33-33-56t-57-25q-102-12-309-12t-310 12q-32 3-57 25t-32 56q-15 62-15 195 0 131 15 195 7 33 32 56t57 26q103 11 310 11t309-11q33-4 57-26t33-56q14-62 14-195z m-557 712h57l-67-223v-151h-56v151q-8 42-34 119-21 57-37 104h60l39-147z m207-186v-97q0-46-16-66-21-29-59-29-38 0-59 29-15 21-15 66v97q0 45 15 65 21 29 59 29 38 0 59-29 16-20 16-65z m187 91v-279h-51v31q-30-35-58-35-25 0-33 21-4 13-4 42v220h51v-205q0-19 0-20 2-12 12-12 15 0 32 24v213h51z" horiz-adv-x="857.1" />
14
- <glyph glyph-name="rss" unicode="&#xe805;" d="m0 730q314 0 537-223t223-537l-118 0q0 266-188 453t-454 187l0 120z m0-238q218 0 371-153t153-369l-118 0q0 166-119 285t-287 119l0 118z m114-296q46 0 80-33t34-81q0-46-34-79t-80-33-80 33-34 79q0 48 34 81t80 33z" horiz-adv-x="760" />
15
- <glyph glyph-name="linkedin" unicode="&#xe806;" d="m204 698q0-40-29-68t-75-28q-44 0-72 28t-28 68q0 42 28 69t74 27 73-27 29-69z m-198-790l0 618 192 0 0-618-192 0z m306 420q0 86-4 198l166 0 10-86 4 0q60 100 190 100 100 0 161-67t61-199l0-366-192 0 0 342q0 134-98 134-70 0-98-72-6-12-6-48l0-356-194 0 0 420z" horiz-adv-x="900" />
16
- <glyph glyph-name="tumblr" unicode="&#xe807;" d="m560-58q-48-26-106-40-48-12-102-12-58 0-110 16-54 20-82 46-36 32-46 64-14 30-14 96l0 322-100 0 0 130q54 18 92 50t62 80q24 52 30 116l130 0 0-232 216 0 0-144-216 0 0-236q0-84 8-102 10-24 32-36 28-20 68-20 68 0 138 46l0-144z" horiz-adv-x="560" />
17
- <glyph glyph-name="stumbleupon" unicode="&#xe808;" d="m552 448l0 60q0 22-15 37t-37 15q-20 0-36-15t-16-37l0-314q0-92-66-158t-158-66-158 66-66 158l0 132 172 0 0-132q0-20 16-36t36-16 36 16 16 36l0 314q0 92 66 157t158 65 158-65 66-157l0-60-102-34z m278-122l170 0 0-132q0-92-66-158t-158-66-158 66-66 158l0 134 70-32 102 32 0-134q0-20 16-36t36-16q22 0 38 15t16 37l0 132z" horiz-adv-x="1000" />
18
- <glyph glyph-name="instagram" unicode="&#xe809;" d="m690 350q0 26-6 50l176 0 0-344q0-56-39-96t-95-40l-592 0q-56 0-95 40t-39 96l0 344 174 0q-4-32-4-50 0-106 76-183t184-77q106 0 183 77t77 183z m36 430q56 0 95-39t39-95l0-146-218 0q-78 110-212 110-138 0-212-110l-218 0 0 146q0 56 39 95t95 39l592 0z m64-166l0 72q0 24-24 24l-72 0q-24 0-24-24l0-72q0-8 7-16t17-8l72 0q24 0 24 24z m-200-264q0-66-47-113t-113-47-113 47-47 113q0 68 47 114t113 46 113-46 47-114z" horiz-adv-x="860" />
19
- <glyph glyph-name="flickr" unicode="&#xe80a;" d="m196 150q-80 0-138 59t-58 141q0 84 57 142t139 58 139-58 57-142q0-82-58-141t-138-59z m508 0q-80 0-138 59t-58 141q0 84 57 142t139 58 139-58 57-142q0-82-58-141t-138-59z" horiz-adv-x="900" />
20
- <glyph glyph-name="mail" unicode="&#xe80b;" d="m30 586q-32 18-28 40 2 14 26 14l846 0q38 0 20-32-8-14-24-22-14-6-192-102t-182-98q-16-10-46-10-28 0-46 10-4 2-182 98t-192 102z m850-100q20 10 20-10l0-368q0-16-17-32t-33-16l-800 0q-16 0-33 16t-17 32l0 368q0 20 20 10l384-200q18-10 46-10t46 10z" horiz-adv-x="900" />
21
- <glyph glyph-name="github" unicode="&#xe80c;" d="m620 286q26 0 45-26t19-64-19-64-45-26q-28 0-47 26t-19 64 19 64 47 26z m226 234q74-80 74-194 0-74-17-133t-43-96-64-65-70-41-73-20-62-8-45-1q-6 0-36-1t-50-1-50 1-36 1q-24 0-45 1t-62 8-73 20-70 41-64 65-43 96-17 133q0 114 74 194-8 4-1 80t33 140q92-10 228-104 46 12 126 12 84 0 126-12 62 42 119 68t83 30l26 6q26-64 33-140t-1-80z m-384-514q166 0 251 40t85 164q0 72-54 120-28 26-65 32t-113 0-104-6l-4 0q-32 0-83 4t-80 5-63-7-56-28q-52-46-52-120 0-124 84-164t250-40l4 0z m-160 280q26 0 45-26t19-64-19-64-45-26q-28 0-47 26t-19 64 19 64 47 26z" horiz-adv-x="920" />
22
- <glyph glyph-name="twitter" unicode="&#xe80d;" d="m920 636q-36-54-94-98l0-24q0-130-60-250t-186-203-290-83q-160 0-290 84 14-2 46-2 132 0 234 80-62 2-110 38t-66 94q10-4 34-4 26 0 50 6-66 14-108 66t-42 120l0 2q36-20 84-24-84 58-84 158 0 48 26 94 154-188 390-196-6 18-6 42 0 78 55 133t135 55q82 0 136-58 60 12 120 44-20-66-82-104 56 8 108 30z" horiz-adv-x="920" />
23
- <glyph glyph-name="vimeo" unicode="&#xe80e;" d="m896 558q-32-186-171-351t-245-237q-42-28-81-17t-66 38-43 61q-16 32-78 239t-74 223q-16 12-38 5t-44-21l-20-14-36 50q18 20 46 52t100 89 124 67q30 6 53-7t36-35 23-60 15-70 12-75 13-67q14-54 21-80t17-54 18-39 18-11q40 0 126 166 42 76 6 124t-112 2q22 126 140 188 104 54 182 8 80-46 58-174z" horiz-adv-x="901" />
24
- <glyph glyph-name="heart" unicode="&#xe80f;" d="m790 644q70-64 70-156t-70-158l-360-330-360 330q-70 66-70 158t70 156q62 58 151 58t153-58l56-52 58 52q62 58 150 58t152-58z" horiz-adv-x="860" />
25
- </font>
26
- </defs>
27
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
font/fontello.ttf DELETED
Binary file
font/fontello.woff DELETED
Binary file
images/sprite_24x24.png ADDED
Binary file
images/sprite_32x32.png ADDED
Binary file
images/sprite_48x48.png ADDED
Binary file
readme.txt CHANGED
@@ -1,15 +1,15 @@
1
  === Plugin Name ===
2
- Contributors: nathanrice, studiopress, bgardner
3
  Tags: social media, social networking, social profiles
4
- Requires at least: 4.0
5
- Tested up to: 4.2.2
6
- Stable tag: 1.0.9
7
 
8
- This plugin allows you to insert social icons in any widget area.
9
 
10
  == Description ==
11
 
12
- Simple Social Icons is an easy to use, customizable way to display icons that link visitors to your various social profiles. With it, you can easily choose which profiles to link to, customize the color and size of your icons, as well as align them to the left, center, or right, all from the widget form (no settings page necessary!).
13
 
14
  == Installation ==
15
 
@@ -24,75 +24,10 @@ Simple Social Icons is an easy to use, customizable way to display icons that li
24
 
25
  No, not at this time.
26
 
27
- = Which services are included? =
28
-
29
- * Bloglovin
30
- * Dribbble
31
- * Email
32
- * Facebook
33
- * Flickr
34
- * Github
35
- * Google+
36
- * Instagram
37
- * LinkedIn
38
- * Pinterest
39
- * RSS
40
- * StumbleUpon
41
- * Tumblr
42
- * Twitter
43
- * Vimeo
44
- * YouTube
45
-
46
- NOTE - The rights to each pictogram in the social extension are either trademarked or copyrighted by the respective company. Icons that are included in the social extension can be identified at http://www.entypo.com/.
47
-
48
  == Changelog ==
49
 
50
  = 0.9.0 =
51
- * Initial Beta Release
52
-
53
- = 0.9.1 =
54
- * Fixed some styling issues
55
-
56
- = 0.9.2 =
57
- * Added new profile options
58
- * Changed default border radius to 3px
59
-
60
- = 0.9.3 =
61
- * Fixed CSS conflict in some themes
62
-
63
- = 0.9.4 =
64
- * Added YouTube icon
65
- * Added bottom margin to icons
66
-
67
- = 0.9.5 =
68
- * Added Instagram icon
69
-
70
- = 1.0.0 =
71
- * Switched to icon fonts, rather than images
72
-
73
- = 1.0.1 =
74
- * Made color and background color more specific in the CSS to avoid conflicts
75
-
76
- = 1.0.2 =
77
- * More specific in the CSS to avoid conflicts
78
-
79
- = 1.0.3 =
80
- * Added Tumblr icon
81
-
82
- = 1.0.4 =
83
- * Updated version in enqueue script function
84
-
85
- = 1.0.5 =
86
- * Updated LICENSE.txt file to include social extension
87
-
88
- = 1.0.6 =
89
- * Added filters
90
-
91
- = 1.0.7 =
92
- * Added Bloglovin icon
93
-
94
- = 1.0.8 =
95
- * Added border options
96
 
97
- = 1.0.9 =
98
- * PHP7 compatibility
1
  === Plugin Name ===
2
+ Contributors: nathanrice, studiopress
3
  Tags: social media, social networking, social profiles
4
+ Requires at least: 3.3
5
+ Tested up to: 3.3.1
6
+ Stable tag: 0.9.1
7
 
8
+ This plugin/widget allows you to insert social icons in any widget area.
9
 
10
  == Description ==
11
 
12
+ Simple Social Icons is an easy to use, customizable way to display icons that link visitors to your various social profiles. With it, you can easily choose which profiles to link to, customize the color and size of your icons, as well as align them to the left or right, all from the widget form (no settings page necessary!).
13
 
14
  == Installation ==
15
 
24
 
25
  No, not at this time.
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  == Changelog ==
28
 
29
  = 0.9.0 =
30
+ * Initial Beta Release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
+ = 0.9.1 =
33
+ * Fixed some styling issues
simple-social-icons.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /*
3
  Plugin Name: Simple Social Icons
4
- Plugin URI: http://wordpress.org/plugins/simple-social-icons/
5
- Description: A simple, CSS and icon font driven social icons widget.
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
- Version: 1.0.9
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
@@ -29,14 +29,7 @@ class Simple_Social_Icons_Widget extends WP_Widget {
29
  protected $sizes;
30
 
31
  /**
32
- * Default widget profile glyphs.
33
- *
34
- * @var array
35
- */
36
- protected $glyphs;
37
-
38
- /**
39
- * Default widget profile values.
40
  *
41
  * @var array
42
  */
@@ -52,202 +45,103 @@ class Simple_Social_Icons_Widget extends WP_Widget {
52
  /**
53
  * Default widget option values.
54
  */
55
- $this->defaults = apply_filters( 'simple_social_default_styles', array(
56
- 'title' => '',
57
- 'new_window' => 0,
58
- 'size' => 36,
59
- 'border_radius' => 3,
60
- 'border_width' => 0,
61
- 'border_color' => '#ffffff',
62
- 'border_color_hover' => '#ffffff',
63
- 'icon_color' => '#ffffff',
64
- 'icon_color_hover' => '#ffffff',
65
- 'background_color' => '#999999',
66
  'background_color_hover' => '#666666',
67
- 'alignment' => 'alignleft',
68
- 'bloglovin' => '',
69
- 'dribbble' => '',
70
- 'email' => '',
71
- 'facebook' => '',
72
- 'flickr' => '',
73
- 'github' => '',
74
- 'gplus' => '',
75
- 'instagram' => '',
76
- 'linkedin' => '',
77
- 'pinterest' => '',
78
- 'rss' => '',
79
- 'stumbleupon' => '',
80
- 'tumblr' => '',
81
- 'twitter' => '',
82
- 'vimeo' => '',
83
- 'youtube' => '',
84
- ) );
85
 
86
  /**
87
- * Social profile glyphs.
88
  */
89
- $this->glyphs = apply_filters( 'simple_social_default_glyphs', array(
90
- 'bloglovin' => '&#xe80f;',
91
- 'dribbble' => '&#xe800;',
92
- 'email' => '&#xe80b;',
93
- 'facebook' => '&#xe802;',
94
- 'flickr' => '&#xe80a;',
95
- 'github' => '&#xe80c;',
96
- 'gplus' => '&#xe801;',
97
- 'instagram' => '&#xe809;',
98
- 'linkedin' => '&#xe806;',
99
- 'pinterest' => '&#xe803;',
100
- 'rss' => '&#xe805;',
101
- 'stumbleupon' => '&#xe808;',
102
- 'tumblr' => '&#xe807;',
103
- 'twitter' => '&#xe80d;',
104
- 'vimeo' => '&#xe80e;',
105
- 'youtube' => '&#xe804;',
106
- ) );
107
 
108
  /**
109
  * Social profile choices.
110
  */
111
- $this->profiles = apply_filters( 'simple_social_default_profiles', array(
112
- 'bloglovin' => array(
113
- 'label' => __( 'Bloglovin URI', 'ssiw' ),
114
- 'pattern' => '<li class="social-bloglovin"><a href="%s" %s>' . $this->glyphs['bloglovin'] . '</a></li>',
115
- ),
116
- 'dribbble' => array(
117
- 'label' => __( 'Dribbble URI', 'ssiw' ),
118
- 'pattern' => '<li class="social-dribbble"><a href="%s" %s>' . $this->glyphs['dribbble'] . '</a></li>',
119
- ),
120
- 'email' => array(
121
- 'label' => __( 'Email URI', 'ssiw' ),
122
- 'pattern' => '<li class="social-email"><a href="%s" %s>' . $this->glyphs['email'] . '</a></li>',
123
- ),
124
  'facebook' => array(
125
- 'label' => __( 'Facebook URI', 'ssiw' ),
126
- 'pattern' => '<li class="social-facebook"><a href="%s" %s>' . $this->glyphs['facebook'] . '</a></li>',
127
- ),
128
- 'flickr' => array(
129
- 'label' => __( 'Flickr URI', 'ssiw' ),
130
- 'pattern' => '<li class="social-flickr"><a href="%s" %s>' . $this->glyphs['flickr'] . '</a></li>',
131
- ),
132
- 'github' => array(
133
- 'label' => __( 'GitHub URI', 'ssiw' ),
134
- 'pattern' => '<li class="social-github"><a href="%s" %s>' . $this->glyphs['github'] . '</a></li>',
135
  ),
136
  'gplus' => array(
137
- 'label' => __( 'Google+ URI', 'ssiw' ),
138
- 'pattern' => '<li class="social-gplus"><a href="%s" %s>' . $this->glyphs['gplus'] . '</a></li>',
139
- ),
140
- 'instagram' => array(
141
- 'label' => __( 'Instagram URI', 'ssiw' ),
142
- 'pattern' => '<li class="social-instagram"><a href="%s" %s>' . $this->glyphs['instagram'] . '</a></li>',
 
143
  ),
144
  'linkedin' => array(
145
- 'label' => __( 'Linkedin URI', 'ssiw' ),
146
- 'pattern' => '<li class="social-linkedin"><a href="%s" %s>' . $this->glyphs['linkedin'] . '</a></li>',
 
 
 
 
 
147
  ),
148
  'pinterest' => array(
149
- 'label' => __( 'Pinterest URI', 'ssiw' ),
150
- 'pattern' => '<li class="social-pinterest"><a href="%s" %s>' . $this->glyphs['pinterest'] . '</a></li>',
 
 
 
 
 
151
  ),
152
  'rss' => array(
153
- 'label' => __( 'RSS URI', 'ssiw' ),
154
- 'pattern' => '<li class="social-rss"><a href="%s" %s>' . $this->glyphs['rss'] . '</a></li>',
155
- ),
156
- 'stumbleupon' => array(
157
- 'label' => __( 'StumbleUpon URI', 'ssiw' ),
158
- 'pattern' => '<li class="social-stumbleupon"><a href="%s" %s>' . $this->glyphs['stumbleupon'] . '</a></li>',
159
- ),
160
- 'tumblr' => array(
161
- 'label' => __( 'Tumblr URI', 'ssiw' ),
162
- 'pattern' => '<li class="social-tumblr"><a href="%s" %s>' . $this->glyphs['tumblr'] . '</a></li>',
163
  ),
164
  'twitter' => array(
165
- 'label' => __( 'Twitter URI', 'ssiw' ),
166
- 'pattern' => '<li class="social-twitter"><a href="%s" %s>' . $this->glyphs['twitter'] . '</a></li>',
167
- ),
168
- 'vimeo' => array(
169
- 'label' => __( 'Vimeo URI', 'ssiw' ),
170
- 'pattern' => '<li class="social-vimeo"><a href="%s" %s>' . $this->glyphs['vimeo'] . '</a></li>',
 
171
  ),
172
- 'youtube' => array(
173
- 'label' => __( 'YouTube URI', 'ssiw' ),
174
- 'pattern' => '<li class="social-youtube"><a href="%s" %s>' . $this->glyphs['youtube'] . '</a></li>',
175
- ),
176
- ) );
177
 
178
  $widget_ops = array(
179
- 'classname' => 'simple-social-icons',
180
  'description' => __( 'Displays select social icons.', 'ssiw' ),
181
  );
182
 
183
  $control_ops = array(
184
  'id_base' => 'simple-social-icons',
 
 
185
  );
186
 
187
- parent::__construct( 'simple-social-icons', __( 'Simple Social Icons', 'ssiw' ), $widget_ops, $control_ops );
188
-
189
- /** Enqueue icon font */
190
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ) );
191
 
192
  /** Load CSS in <head> */
193
  add_action( 'wp_head', array( $this, 'css' ) );
194
 
195
- /** Load color picker */
196
- add_action( 'admin_enqueue_scripts', array( $this, 'load_color_picker' ) );
197
- add_action( 'admin_footer-widgets.php', array( $this, 'print_scripts' ), 9999 );
198
-
199
- }
200
-
201
- /**
202
- * Color Picker.
203
- *
204
- * Enqueue the color picker script.
205
- *
206
- */
207
- function load_color_picker( $hook ) {
208
- if( 'widgets.php' != $hook )
209
- return;
210
- wp_enqueue_style( 'wp-color-picker' );
211
- wp_enqueue_script( 'wp-color-picker' );
212
- wp_enqueue_script( 'underscore' );
213
- }
214
-
215
- /**
216
- * Print scripts.
217
- *
218
- * Reference https://core.trac.wordpress.org/attachment/ticket/25809/color-picker-widget.php
219
- *
220
- */
221
- function print_scripts() {
222
- ?>
223
- <script>
224
- ( function( $ ){
225
- function initColorPicker( widget ) {
226
- widget.find( '.ssiw-color-picker' ).wpColorPicker( {
227
- change: function ( event ) {
228
- var $picker = $( this );
229
- _.throttle(setTimeout(function () {
230
- $picker.trigger( 'change' );
231
- }, 5), 250);
232
- },
233
- width: 235,
234
- });
235
- }
236
-
237
- function onFormUpdate( event, widget ) {
238
- initColorPicker( widget );
239
- }
240
-
241
- $( document ).on( 'widget-added widget-updated', onFormUpdate );
242
-
243
- $( document ).ready( function() {
244
- $( '#widgets-right .widget:has(.ssiw-color-picker)' ).each( function () {
245
- initColorPicker( $( this ) );
246
- } );
247
- } );
248
- }( jQuery ) );
249
- </script>
250
- <?php
251
  }
252
 
253
  /**
@@ -266,43 +160,38 @@ class Simple_Social_Icons_Widget extends WP_Widget {
266
 
267
  <p><label><input id="<?php echo $this->get_field_id( 'new_window' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'new_window' ); ?>" value="1" <?php checked( 1, $instance['new_window'] ); ?>/> <?php esc_html_e( 'Open links in new window?', 'ssiw' ); ?></label></p>
268
 
269
- <p><label for="<?php echo $this->get_field_id( 'size' ); ?>"><?php _e( 'Icon Size', 'ssiw' ); ?>:</label> <input id="<?php echo $this->get_field_id( 'size' ); ?>" name="<?php echo $this->get_field_name( 'size' ); ?>" type="text" value="<?php echo esc_attr( $instance['size'] ); ?>" size="3" />px</p>
 
 
 
 
 
 
 
 
 
270
 
271
  <p><label for="<?php echo $this->get_field_id( 'border_radius' ); ?>"><?php _e( 'Icon Border Radius:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'border_radius' ); ?>" name="<?php echo $this->get_field_name( 'border_radius' ); ?>" type="text" value="<?php echo esc_attr( $instance['border_radius'] ); ?>" size="3" />px</p>
272
 
273
- <p><label for="<?php echo $this->get_field_id( 'border_width' ); ?>"><?php _e( 'Border Width:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'border_width' ); ?>" name="<?php echo $this->get_field_name( 'border_width' ); ?>" type="text" value="<?php echo esc_attr( $instance['border_width'] ); ?>" size="3" />px</p>
 
 
274
 
275
  <p>
276
  <label for="<?php echo $this->get_field_id( 'alignment' ); ?>"><?php _e( 'Alignment', 'ssiw' ); ?>:</label>
277
  <select id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
278
  <option value="alignleft" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Left', 'ssiw' ); ?></option>
279
- <option value="aligncenter" <?php selected( 'aligncenter', $instance['alignment'] ) ?>><?php _e( 'Align Center', 'ssiw' ); ?></option>
280
  <option value="alignright" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Right', 'ssiw' ); ?></option>
281
  </select>
282
  </p>
283
 
284
  <hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
285
 
286
- <p><label for="<?php echo $this->get_field_id( 'background_color' ); ?>"><?php _e( 'Icon Font Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'icon_color' ); ?>" name="<?php echo $this->get_field_name( 'icon_color' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['icon_color'] ); ?>" value="<?php echo esc_attr( $instance['icon_color'] ); ?>" size="6" /></p>
287
-
288
- <p><label for="<?php echo $this->get_field_id( 'background_color_hover' ); ?>"><?php _e( 'Icon Font Hover Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'icon_color_hover' ); ?>" name="<?php echo $this->get_field_name( 'icon_color_hover' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['icon_color_hover'] ); ?>" value="<?php echo esc_attr( $instance['icon_color_hover'] ); ?>" size="6" /></p>
289
-
290
- <p><label for="<?php echo $this->get_field_id( 'background_color' ); ?>"><?php _e( 'Background Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'background_color' ); ?>" name="<?php echo $this->get_field_name( 'background_color' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['background_color'] ); ?>" value="<?php echo esc_attr( $instance['background_color'] ); ?>" size="6" /></p>
291
-
292
- <p><label for="<?php echo $this->get_field_id( 'background_color_hover' ); ?>"><?php _e( 'Background Hover Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'background_color_hover' ); ?>" name="<?php echo $this->get_field_name( 'background_color_hover' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['background_color_hover'] ); ?>" value="<?php echo esc_attr( $instance['background_color_hover'] ); ?>" size="6" /></p>
293
-
294
- <p><label for="<?php echo $this->get_field_id( 'border_color' ); ?>"><?php _e( 'Border Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'border_color' ); ?>" name="<?php echo $this->get_field_name( 'border_color' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['border_color'] ); ?>" value="<?php echo esc_attr( $instance['border_color'] ); ?>" size="6" /></p>
295
-
296
- <p><label for="<?php echo $this->get_field_id( 'border_color_hover' ); ?>"><?php _e( 'Border Hover Color:', 'ssiw' ); ?></label><br /> <input id="<?php echo $this->get_field_id( 'border_color_hover' ); ?>" name="<?php echo $this->get_field_name( 'border_color_hover' ); ?>" type="text" class="ssiw-color-picker" data-default-color="<?php echo esc_attr( $this->defaults['border_color_hover'] ); ?>" value="<?php echo esc_attr( $instance['border_color_hover'] ); ?>" size="6" /></p>
297
-
298
- <hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
299
-
300
  <?php
301
  foreach ( (array) $this->profiles as $profile => $data ) {
302
 
303
- printf( '<p><label for="%s">%s:</label></p>', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $data['label'] ) );
304
- printf( '<p><input type="text" id="%s" name="%s" value="%s" class="widefat" />', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $this->get_field_name( $profile ) ), esc_url( $instance[$profile] ) );
305
- printf( '</p>' );
306
 
307
  }
308
 
@@ -318,12 +207,8 @@ class Simple_Social_Icons_Widget extends WP_Widget {
318
 
319
  foreach ( $newinstance as $key => $value ) {
320
 
321
- /** Border radius and Icon size must not be empty, must be a digit */
322
- if ( ( 'border_radius' == $key || 'size' == $key ) && ( '' == $value || ! ctype_digit( $value ) ) ) {
323
- $newinstance[$key] = 0;
324
- }
325
-
326
- if ( ( 'border_width' == $key || 'size' == $key ) && ( '' == $value || ! ctype_digit( $value ) ) ) {
327
  $newinstance[$key] = 0;
328
  }
329
 
@@ -365,18 +250,9 @@ class Simple_Social_Icons_Widget extends WP_Widget {
365
 
366
  $new_window = $instance['new_window'] ? 'target="_blank"' : '';
367
 
368
- $profiles = (array) $this->profiles;
369
-
370
- foreach ( $profiles as $profile => $data ) {
371
-
372
- if ( empty( $instance[ $profile ] ) )
373
- continue;
374
-
375
- if ( is_email( $instance[ $profile ] ) )
376
- $output .= sprintf( $data['pattern'], 'mailto:' . esc_attr( $instance[$profile] ), $new_window );
377
- else
378
  $output .= sprintf( $data['pattern'], esc_url( $instance[$profile] ), $new_window );
379
-
380
  }
381
 
382
  if ( $output )
@@ -386,13 +262,6 @@ class Simple_Social_Icons_Widget extends WP_Widget {
386
 
387
  }
388
 
389
- function enqueue_css() {
390
-
391
- $cssfile = apply_filters( 'simple_social_default_css', plugin_dir_url( __FILE__ ) . 'css/style.css' );
392
-
393
- wp_enqueue_style( 'simple-social-icons-font', esc_url( $cssfile ), array(), '1.0.5', 'all' );
394
- }
395
-
396
  /**
397
  * Custom CSS.
398
  *
@@ -404,27 +273,53 @@ class Simple_Social_Icons_Widget extends WP_Widget {
404
  $all_instances = $this->get_settings();
405
  $instance = wp_parse_args( $all_instances[$this->number], $this->defaults );
406
 
407
- $font_size = round( (int) $instance['size'] / 2 );
408
- $icon_padding = round ( (int) $font_size / 2 );
 
 
 
 
409
 
410
  /** The CSS to output */
411
- $css = '
 
 
 
 
 
 
 
 
412
  .simple-social-icons ul li a,
413
  .simple-social-icons ul li a:hover {
414
- background-color: ' . $instance['background_color'] . ' !important;
 
 
415
  border-radius: ' . $instance['border_radius'] . 'px;
416
- color: ' . $instance['icon_color'] . ' !important;
417
- border: ' . $instance['border_width'] . 'px ' . $instance['border_color'] . ' solid !important;
418
- font-size: ' . $font_size . 'px;
419
- padding: ' . $icon_padding . 'px;
 
420
  }
421
 
422
  .simple-social-icons ul li a:hover {
423
- background-color: ' . $instance['background_color_hover'] . ' !important;
424
- border-color: ' . $instance['border_color_hover'] . ' !important;
425
- color: ' . $instance['icon_color_hover'] . ' !important;
426
  }';
427
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  /** Minify a bit */
429
  $css = str_replace( "\t", '', $css );
430
  $css = str_replace( array( "\n", "\r" ), ' ', $css );
1
  <?php
2
  /*
3
  Plugin Name: Simple Social Icons
4
+ Plugin URI: http://www.studiopress.com/plugins/simple-social-icons
5
+ Description: A simple, CSS and sprite driven social icons widget.
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
+ Version: 0.9.1
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
29
  protected $sizes;
30
 
31
  /**
32
+ * Default widget values.
 
 
 
 
 
 
 
33
  *
34
  * @var array
35
  */
45
  /**
46
  * Default widget option values.
47
  */
48
+ $this->defaults = array(
49
+ 'title' => '',
50
+ 'new_window' => 0,
51
+ 'size' => 32,
52
+ 'border_radius' => 6,
53
+ 'background_color' => '#999999',
 
 
 
 
 
54
  'background_color_hover' => '#666666',
55
+ 'alignment' => 'alignleft',
56
+ 'facebook' => '',
57
+ 'gplus' => '',
58
+ 'linkedin' => '',
59
+ 'pinterest' => '',
60
+ 'rss' => '',
61
+ 'twitter' => '',
62
+ );
 
 
 
 
 
 
 
 
 
 
63
 
64
  /**
65
+ * Icon sizes.
66
  */
67
+ $this->sizes = array( '24', '32', '48' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  /**
70
  * Social profile choices.
71
  */
72
+ $this->profiles = array(
 
 
 
 
 
 
 
 
 
 
 
 
73
  'facebook' => array(
74
+ 'label' => __( 'Facebook URI', 'ssiw' ),
75
+ 'pattern' => '<li class="social-facebook"><a href="%s" %s>Facebook</a></li>',
76
+ 'background_positions' => array(
77
+ '24' => '0 0',
78
+ '32' => '0 0',
79
+ '48' => '0 0',
80
+ )
 
 
 
81
  ),
82
  'gplus' => array(
83
+ 'label' => __( 'Google+ URI', 'ssiw' ),
84
+ 'pattern' => '<li class="social-gplus"><a href="%s" %s>Google+</a></li>',
85
+ 'background_positions' => array(
86
+ '24' => '-24px 0',
87
+ '32' => '-32px 0',
88
+ '48' => '-48px 0',
89
+ )
90
  ),
91
  'linkedin' => array(
92
+ 'label' => __( 'Linkedin URI', 'ssiw' ),
93
+ 'pattern' => '<li class="social-linkedin"><a href="%s" %s>Linkedin</a></li>',
94
+ 'background_positions' => array(
95
+ '24' => '-48px 0',
96
+ '32' => '-64px 0',
97
+ '48' => '-96px 0',
98
+ )
99
  ),
100
  'pinterest' => array(
101
+ 'label' => __( 'Pinterest URI', 'ssiw' ),
102
+ 'pattern' => '<li class="social-pinterest"><a href="%s" %s>Pinterest</a></li>',
103
+ 'background_positions' => array(
104
+ '24' => '-72px 0',
105
+ '32' => '-96px 0',
106
+ '48' => '-144px 0',
107
+ )
108
  ),
109
  'rss' => array(
110
+ 'label' => __( 'RSS URI', 'ssiw' ),
111
+ 'pattern' => '<li class="social-rss"><a href="%s" %s>RSS</a></li>',
112
+ 'background_positions' => array(
113
+ '24' => '-96px 0',
114
+ '32' => '-128px 0',
115
+ '48' => '-192px 0',
116
+ )
 
 
 
117
  ),
118
  'twitter' => array(
119
+ 'label' => __( 'Twitter URI', 'ssiw' ),
120
+ 'pattern' => '<li class="social-twitter"><a href="%s" %s>Twitter</a></li>',
121
+ 'background_positions' => array(
122
+ '24' => '-120px 0',
123
+ '32' => '-160px 0',
124
+ '48' => '-240px 0',
125
+ )
126
  ),
127
+ );
 
 
 
 
128
 
129
  $widget_ops = array(
130
+ 'classname' => 'simple-social-icons',
131
  'description' => __( 'Displays select social icons.', 'ssiw' ),
132
  );
133
 
134
  $control_ops = array(
135
  'id_base' => 'simple-social-icons',
136
+ #'width' => 505,
137
+ #'height' => 350,
138
  );
139
 
140
+ $this->WP_Widget( 'simple-social-icons', __( 'Simple Social Icons', 'ssiw' ), $widget_ops, $control_ops );
 
 
 
141
 
142
  /** Load CSS in <head> */
143
  add_action( 'wp_head', array( $this, 'css' ) );
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
 
147
  /**
160
 
161
  <p><label><input id="<?php echo $this->get_field_id( 'new_window' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'new_window' ); ?>" value="1" <?php checked( 1, $instance['new_window'] ); ?>/> <?php esc_html_e( 'Open links in new window?', 'ssiw' ); ?></label></p>
162
 
163
+ <p>
164
+ <label for="<?php echo $this->get_field_id( 'size' ); ?>"><?php _e( 'Icon Size', 'ssiw' ); ?>:</label>
165
+ <select id="<?php echo $this->get_field_id( 'size' ); ?>" name="<?php echo $this->get_field_name( 'size' ); ?>">
166
+ <?php
167
+ foreach ( (array) $this->sizes as $size ) {
168
+ printf( '<option value="%d" %s>%dpx</option>', (int) $size, selected( $size, $instance['size'], 0 ), (int) $size );
169
+ }
170
+ ?>
171
+ </select>
172
+ </p>
173
 
174
  <p><label for="<?php echo $this->get_field_id( 'border_radius' ); ?>"><?php _e( 'Icon Border Radius:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'border_radius' ); ?>" name="<?php echo $this->get_field_name( 'border_radius' ); ?>" type="text" value="<?php echo esc_attr( $instance['border_radius'] ); ?>" size="3" />px</p>
175
 
176
+ <p><label for="<?php echo $this->get_field_id( 'background_color' ); ?>"><?php _e( 'Icon Color:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'background_color' ); ?>" name="<?php echo $this->get_field_name( 'background_color' ); ?>" type="text" value="<?php echo esc_attr( $instance['background_color'] ); ?>" size="8" /></p>
177
+
178
+ <p><label for="<?php echo $this->get_field_id( 'background_color_hover' ); ?>"><?php _e( 'Hover Color:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'background_color_hover' ); ?>" name="<?php echo $this->get_field_name( 'background_color_hover' ); ?>" type="text" value="<?php echo esc_attr( $instance['background_color_hover'] ); ?>" size="8" /></p>
179
 
180
  <p>
181
  <label for="<?php echo $this->get_field_id( 'alignment' ); ?>"><?php _e( 'Alignment', 'ssiw' ); ?>:</label>
182
  <select id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
183
  <option value="alignleft" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Left', 'ssiw' ); ?></option>
 
184
  <option value="alignright" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Right', 'ssiw' ); ?></option>
185
  </select>
186
  </p>
187
 
188
  <hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  <?php
191
  foreach ( (array) $this->profiles as $profile => $data ) {
192
 
193
+ printf( '<p><label for="%s">%s:</label>', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $data['label'] ) );
194
+ printf( '<input type="text" id="%s" class="widefat" name="%s" value="%s" /></p>', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $this->get_field_name( $profile ) ), esc_url( $instance[$profile] ) );
 
195
 
196
  }
197
 
207
 
208
  foreach ( $newinstance as $key => $value ) {
209
 
210
+ /** Border radius must not be empty, must be a digit */
211
+ if ( 'border_radius' == $key && ( '' == $value || ! ctype_digit( $value ) ) ) {
 
 
 
 
212
  $newinstance[$key] = 0;
213
  }
214
 
250
 
251
  $new_window = $instance['new_window'] ? 'target="_blank"' : '';
252
 
253
+ foreach ( (array) $this->profiles as $profile => $data ) {
254
+ if ( ! empty( $instance[$profile] ) )
 
 
 
 
 
 
 
 
255
  $output .= sprintf( $data['pattern'], esc_url( $instance[$profile] ), $new_window );
 
256
  }
257
 
258
  if ( $output )
262
 
263
  }
264
 
 
 
 
 
 
 
 
265
  /**
266
  * Custom CSS.
267
  *
273
  $all_instances = $this->get_settings();
274
  $instance = wp_parse_args( $all_instances[$this->number], $this->defaults );
275
 
276
+ /** The image locations */
277
+ $imgs = array(
278
+ '24' => plugin_dir_url( __FILE__ ) . 'images/sprite_24x24.png',
279
+ '32' => plugin_dir_url( __FILE__ ) . 'images/sprite_32x32.png',
280
+ '48' => plugin_dir_url( __FILE__ ) . 'images/sprite_48x48.png'
281
+ );
282
 
283
  /** The CSS to output */
284
+ $css = '.simple-social-icons {
285
+ overflow: hidden;
286
+ }
287
+ .simple-social-icons .alignleft, .simple-social-icons .alignright {
288
+ margin: 0; padding: 0;
289
+ }
290
+ .simple-social-icons ul li, .sidebar .simple-social-icons ul li {
291
+ background: none; border: none; float: left; list-style-type: none; margin: 0 5px; padding: 0;
292
+ }
293
  .simple-social-icons ul li a,
294
  .simple-social-icons ul li a:hover {
295
+ background: ' . $instance['background_color'] . ' url(' . $imgs[$instance['size']] . ') no-repeat;
296
+ -moz-border-radius: ' . $instance['border_radius'] . 'px
297
+ -webkit-border-radius: ' . $instance['border_radius'] . 'px;
298
  border-radius: ' . $instance['border_radius'] . 'px;
299
+ display: block;
300
+ height: ' . $instance['size'] . 'px;
301
+ overflow: hidden;
302
+ text-indent: -999px;
303
+ width: ' . $instance['size'] . 'px;
304
  }
305
 
306
  .simple-social-icons ul li a:hover {
307
+ background-color: ' . $instance['background_color_hover'] . ';
 
 
308
  }';
309
 
310
+ /** Individual Profile button styles */
311
+ foreach ( (array) $this->profiles as $profile => $data ) {
312
+
313
+ if ( ! $instance[$profile] )
314
+ continue;
315
+
316
+ $css .= '.simple-social-icons ul li.social-' . $profile . ' a,
317
+ .simple-social-icons ul li.social-' . $profile . ' a:hover {
318
+ background-position: ' . $data['background_positions'][$instance['size']] . ';
319
+ }';
320
+
321
+ }
322
+
323
  /** Minify a bit */
324
  $css = str_replace( "\t", '', $css );
325
  $css = str_replace( array( "\n", "\r" ), ' ', $css );