Version Description
- Switched to icon fonts, rather than images
Download this release
Release Info
Developer | nathanrice |
Plugin | Simple Social Icons |
Version | 1.0.0 |
Comparing to | |
See all releases |
Code changes from version 0.9.5 to 1.0.0
- css/style.css +62 -0
- font/LICENSE.txt +21 -0
- font/fontello.eot +0 -0
- font/fontello.svg +79 -0
- font/fontello.ttf +0 -0
- font/fontello.woff +0 -0
- images/sprite_24x24.png +0 -0
- images/sprite_32x32.png +0 -0
- images/sprite_48x48.png +0 -0
- readme.txt +25 -5
- simple-social-icons.php +94 -162
css/style.css
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'fontello';
|
3 |
+
src: url("../font/fontello.eot?11995952");
|
4 |
+
src: url("../font/fontello.eot?11995952#iefix") format('embedded-opentype'), url("../font/fontello.woff?11995952") format('woff'), url("../font/fontello.ttf?11995952") format('truetype'), url("../font/fontello.svg?11995952#fontello") format('svg');
|
5 |
+
font-weight: normal;
|
6 |
+
font-style: normal;
|
7 |
+
}
|
8 |
+
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
9 |
+
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
10 |
+
/*
|
11 |
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
12 |
+
@font-face {
|
13 |
+
font-family: 'fontello';
|
14 |
+
src: url('../font/fontello.svg?11995952#fontello') format('svg');
|
15 |
+
}
|
16 |
+
}
|
17 |
+
*/
|
18 |
+
|
19 |
+
.simple-social-icons {
|
20 |
+
overflow: hidden;
|
21 |
+
}
|
22 |
+
|
23 |
+
.simple-social-icons ul {
|
24 |
+
margin: 0;
|
25 |
+
padding: 0;
|
26 |
+
}
|
27 |
+
|
28 |
+
.simple-social-icons ul li {
|
29 |
+
background: none !important;
|
30 |
+
border: none !important;
|
31 |
+
float: left;
|
32 |
+
list-style-type: none !important;
|
33 |
+
margin: 0 6px 12px !important;
|
34 |
+
padding: 0 !important;
|
35 |
+
}
|
36 |
+
|
37 |
+
.simple-social-icons ul li a {
|
38 |
+
border: none !important;
|
39 |
+
-moz-box-sizing: content-box;
|
40 |
+
-webkit-box-sizing: content-box;
|
41 |
+
box-sizing: content-box;
|
42 |
+
display: inline-block;
|
43 |
+
font-family: 'fontello';
|
44 |
+
font-style: normal;
|
45 |
+
font-variant: normal;
|
46 |
+
font-weight: normal;
|
47 |
+
line-height: 1em;
|
48 |
+
speak: none;
|
49 |
+
text-align: center;
|
50 |
+
text-decoration: none;
|
51 |
+
text-transform: none;
|
52 |
+
width: 1em;
|
53 |
+
}
|
54 |
+
|
55 |
+
.simple-social-icons ul.aligncenter {
|
56 |
+
text-align: center;
|
57 |
+
}
|
58 |
+
|
59 |
+
.simple-social-icons ul.aligncenter li {
|
60 |
+
display: inline-block;
|
61 |
+
float: none;
|
62 |
+
}
|
font/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
font/fontello.eot
ADDED
Binary file
|
font/fontello.svg
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
5 |
+
Created by FontForge 20100429 at Sun Mar 24 22:13:55 2013
|
6 |
+
By root
|
7 |
+
Copyright (C) 2012 by original authors @ fontello.com
|
8 |
+
</metadata>
|
9 |
+
<defs>
|
10 |
+
<font id="fontello" horiz-adv-x="930" >
|
11 |
+
<font-face
|
12 |
+
font-family="fontello"
|
13 |
+
font-weight="500"
|
14 |
+
font-stretch="normal"
|
15 |
+
units-per-em="1000"
|
16 |
+
panose-1="2 0 6 3 0 0 0 0 0 0"
|
17 |
+
ascent="850"
|
18 |
+
descent="-150"
|
19 |
+
bbox="14 -150 1015 851.484"
|
20 |
+
underline-thickness="50"
|
21 |
+
underline-position="-100"
|
22 |
+
unicode-range="U+2709-F32D"
|
23 |
+
/>
|
24 |
+
<missing-glyph horiz-adv-x="364"
|
25 |
+
d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
|
26 |
+
<glyph glyph-name=".notdef" horiz-adv-x="364"
|
27 |
+
d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
|
28 |
+
<glyph glyph-name=".null" horiz-adv-x="0"
|
29 |
+
/>
|
30 |
+
<glyph glyph-name="nonmarkingreturn" horiz-adv-x="333"
|
31 |
+
/>
|
32 |
+
<glyph glyph-name="uni2709" unicode="✉"
|
33 |
+
d="M17 626q2 14 26 14h846q38 0 20 -32q-8 -15 -24 -22l-97 -51l-180 -97q-93 -50 -97 -52q-16 -10 -46 -10q-29 0 -46 10q-4 2 -97 52l-180 97l-97 51q-32 18 -28 40zM895 486q20 11 20 -10v-368q0 -16 -17 -32t-33 -16h-800q-16 0 -33 16t-17 32v368q0 21 20 10l384 -200
|
34 |
+
q17 -10 46 -10t46 10z" />
|
35 |
+
<glyph glyph-name="uniE73A" unicode="" horiz-adv-x="790"
|
36 |
+
d="M552 507q223 -223 223 -537h-118q0 265 -188 453q-187 187 -454 187v120q314 0 537 -223zM386 339q153 -153 153 -369h-118q0 166 -119 285t-287 119v118q218 0 371 -153zM129 196q47 0 80.5 -34t33.5 -80t-34 -79t-80 -33t-80 33t-34 79t33.5 80t80.5 34z" />
|
37 |
+
<glyph glyph-name="uniF300" unicode="" horiz-adv-x="950"
|
38 |
+
d="M635 286q28 0 46 -27.5t18 -62.5t-18 -62.5t-46 -27.5q-30 0 -48 27.5t-18 62.5t18 62.5t48 27.5zM475 -40q-8 0 -43.5 1t-42.5 1q-110 0 -180 29q-37 15 -74.5 44.5t-59.5 61.5q-60 84 -60 229q0 114 74 194q-8 5 -1 80t33 140q93 -11 228 -104q47 12 126 12
|
39 |
+
q84 0 126 -12q63 43 119 68q57 25 83 30l26 6q26 -65 33 -140t-1 -80q74 -80 74 -194q0 -203 -124 -294q-37 -26 -67 -39.5t-76 -21.5q-53 -9 -107 -9q-7 0 -42.5 -1t-43.5 -1zM477 356h-4q-21 0 -85 4.5t-78 4.5q-77 3 -119 -35q-52 -46 -52 -120q0 -124 84 -164
|
40 |
+
q83 -40 250 -40h4q167 0 251 40q85 40 85 164q0 55 -34 99.5t-85 52.5q-37 6 -113 0q-77 -6 -104 -6zM317 286q28 0 46 -27.5t18 -62.5t-18 -62.5t-46 -27.5q-30 0 -48 27.5t-18 62.5t18 62.5t48 27.5z" />
|
41 |
+
<glyph glyph-name="uniF303" unicode=""
|
42 |
+
d="M211 550q82 0 139 -58.5t57 -141.5t-58 -141q-59 -59 -138 -59t-138 59q-58 58 -58 141t57 141.5t139 58.5zM719 150q-79 0 -138 59q-58 58 -58 141t57 141.5t139 58.5t139 -58.5t57 -141.5t-58 -141q-59 -59 -138 -59z" />
|
43 |
+
<glyph glyph-name="uniF306" unicode="" horiz-adv-x="931"
|
44 |
+
d="M911 558q-31 -186 -171 -351q-141 -167 -245 -237q-33 -19 -61.5 -19.5t-54.5 16.5t-44.5 39t-29.5 46q-14 28 -78.5 238.5t-73.5 223.5q-27 20 -82 -16l-20 -14l-36 50q6 6 21 24l25 28q31 35 100 89q71 56 124 67q58 12 89 -42q25 -40 38 -130q21 -126 25 -142
|
45 |
+
q28 -106 38 -134q11 -28 18 -39q8 -11 18 -11q41 0 126 166q42 76 6 124t-112 2q23 127 140 188q104 54 182 8q80 -47 58 -174z" />
|
46 |
+
<glyph glyph-name="uniF309" unicode="" horiz-adv-x="950"
|
47 |
+
d="M935 636q-37 -56 -94 -98v-24q0 -130 -60 -250q-60 -121 -186 -203q-127 -83 -290 -83q-159 0 -290 84q18 -2 46 -2q131 0 234 80q-64 2 -111.5 39t-64.5 93q9 -4 34 -4q26 0 50 6q-63 13 -106.5 64.5t-43.5 121.5v2q36 -20 84 -24q-84 58 -84 158q0 47 26 94
|
48 |
+
q155 -189 390 -196q-6 18 -6 42q0 78 55.5 133t134.5 55q82 0 136 -58q58 12 120 44q-19 -66 -82 -104q55 8 108 30z" />
|
49 |
+
<glyph glyph-name="uniF30C" unicode="" horiz-adv-x="530"
|
50 |
+
d="M515 644h-142q-16 0 -26 -16.5t-10 -35.5v-102h178v-148h-178v-442h-170v442h-152v148h152v86q0 92 58.5 158t147.5 66h142v-156z" />
|
51 |
+
<glyph glyph-name="uniF30F" unicode="" horiz-adv-x="926"
|
52 |
+
d="M291 282q-32 45 -32 86l2 14h-14q-63 0 -110 30q-74 44 -74 160q0 53 23.5 98.5t57.5 68.5q75 51 151 51h230v-4q0 -22 -78 -36q-27 0 -38 -6q39 -20 53.5 -54.5t14.5 -97.5q0 -102 -68 -158q-38 -38 -38 -54q0 -17 50 -64q104 -90 104 -178q0 -140 -116 -194
|
53 |
+
q-67 -34 -150 -34h-4l-4 2q-2 -2 -4 -2q-57 0 -129 26q-47 16 -75 58t-28 102t32 101t83 57q89 28 159 28h2zM271 236q-59 -2 -109.5 -43t-46.5 -97q4 -54 58 -82t119.5 -22t103.5 40q41 37 37 88q-4 54 -44 85t-102 31h-16zM251 728q-10 0 -20 -2q-40 -12 -58 -62
|
54 |
+
q-15 -59 -1 -109t46 -82q33 -33 71 -33q10 0 18 2q42 12 63 66t3 112q-30 108 -122 108zM761 446h150v-94h-150v-150h-94v150h-150v94h150v150h94v-150z" />
|
55 |
+
<glyph glyph-name="uniF312" unicode="" horiz-adv-x="808"
|
56 |
+
d="M335 190q-24 -124 -58 -211q-31 -81 -96 -129q-10 120 -5 167q2 28 9 63q18 96 48 203q17 59 24 99q-24 51 -19 116q5 61 47 105t100 21q72 -28 31 -154q-27 -85 -32 -103q-15 -50 -4 -90q10 -38 63 -49q72 -15 123.5 39.5t71.5 129.5q21 81 11 163q-11 85 -54 128
|
57 |
+
q-61 64 -151 70q-96 6 -168 -35.5t-115 -114.5q-46 -77 -32 -170q5 -23 22 -52q21 -36 22 -51.5t-18 -62.5q-146 35 -140 230q5 138 105 234q100 95 233 112q164 18 290 -57t144 -219q26 -176 -66 -317q-91 -141 -252 -129q-23 2 -42 9t-30 13.5t-31 20.5q-23 16 -31 21z
|
58 |
+
" />
|
59 |
+
<glyph glyph-name="uniF313" unicode="" horiz-adv-x="793"
|
60 |
+
d="M673 468h-57v32q-35 -35 -67 -35q-41 0 -41 50v235h58v-216q0 -19 15.5 -19t34.5 22v213h57v-282zM379 757q35 0 58 -19.5t23 -53.5v-145q0 -37 -22.5 -57.5t-61.5 -20.5q-37 0 -60 21.5t-23 57.5v145q0 35 24.5 53.5t61.5 18.5zM376 709q-9 0 -16 -6t-7 -15v-154
|
61 |
+
q0 -23 23 -23q25 0 25 23v154q0 8 -8 14.5t-17 6.5zM230 850h66l-49 -148q-1 -2 -11.5 -31t-14.5 -44v-159h-64v152q-1 8 -27 76l-51 154h66l41 -152h5zM775 54q-4 -43 -34.5 -70.5t-76.5 -29.5q-99 -4 -267 -4q-170 0 -267 4q-46 2 -77 29.5t-34 70.5q-5 87 -5 131t5 130
|
62 |
+
q3 44 34 71.5t77 28.5q97 5 267 5t267 -5q46 -1 76.5 -28.5t34.5 -71.5q5 -86 5 -130t-5 -131zM580 103q0 -32 17.5 -51.5t49.5 -19.5q69 0 69 71v17h-47v-10v-10q0 -3 -0.5 -8.5t-2 -8t-3.5 -5.5t-6 -4.5t-9 -1.5q-20 0 -20 32v43h88v58q0 31 -17 49t-48 18t-51 -19
|
63 |
+
t-20 -48v-102zM544 212q0 57 -44 57q-23 0 -42 -21v99h-47v-309h47v18q21 -20 44 -20q42 0 42 50v126zM365 38v228h-45v-173q-15 -17 -28 -17q-12 0 -12 15v175h-47v-192q0 -39 33 -39q26 0 54 28v-25h45zM234 302v45h-161v-45h54v-264h52v264h55zM669 182h-41v25
|
64 |
+
q0 25 21 25q20 0 20 -25v-25zM497 210v-120q0 -18 -16 -18q-13 0 -23 9v143q9 9 20 9q19 0 19 -23z" />
|
65 |
+
<glyph glyph-name="uniF318" unicode=""
|
66 |
+
d="M219 698q0 -42 -30 -69t-74 -27q-42 0 -71 27.5t-29 68.5q0 43 28.5 69.5t73.5 26.5t72.5 -26.5t29.5 -69.5zM21 526h192v-618h-192v618zM327 328q0 98 -4 198h166l10 -86h4q60 100 190 100q108 0 165 -72t57 -194v-366h-192v342q0 134 -98 134q-69 0 -98 -72
|
67 |
+
q-6 -12 -6 -48v-356h-194v420z" />
|
68 |
+
<glyph glyph-name="uniF31B" unicode="" horiz-adv-x="950"
|
69 |
+
d="M453 480q-48 85 -122 193q-19 29 -24 33q-80 -39 -137.5 -111t-78.5 -163q182 0 362 48zM517 352q-11 31 -32 68q-183 -56 -402 -56v-14q0 -150 100 -262q9 15 13 21q42 62 103 119q37 35 94 68.5t110 51.5q7 4 14 4zM233 42l-8 6q6 -6 8 -6zM381 732zM735 646
|
70 |
+
q-115 98 -260 98q-49 0 -92 -12q79 -104 146 -228q139 53 204 140zM150 25q-135 135 -135 325t135 325t325 135t325 -135t135 -325t-135 -325t-325 -135t-325 135zM543 286q-216 -74 -308 -242l-2 -2q109 -84 242 -84q76 0 154 32q-24 141 -84 298zM585 388l10 -20
|
71 |
+
q110 13 230 -6q35 -6 42 -8q0 139 -88 246l-8 -10q-18 -23 -68 -63q-64 -50 -144 -83q14 -28 26 -56zM619 306q52 -146 76 -280q139 91 168 262q-5 3 -39 11q-104 24 -205 7z" />
|
72 |
+
<glyph glyph-name="uniF31E" unicode="" horiz-adv-x="1030"
|
73 |
+
d="M239 142q19 0 35.5 16t16.5 36v314q0 92 66 157q67 65 158 65t158 -65q66 -65 66 -157v-60l-102 -34l-70 34v60q0 22 -15 37t-37 15q-20 0 -36 -15.5t-16 -36.5v-314q0 -92 -66 -158t-158 -66t-158 66t-66 158v132h172v-132q0 -20 16.5 -36t35.5 -16zM845 326h170v-132
|
74 |
+
q0 -92 -66 -158t-158 -66t-158 66t-66 158v134l70 -32l102 32v-134q0 -20 16.5 -36t35.5 -16q22 0 38 15t16 37v132z" />
|
75 |
+
<glyph glyph-name="uniF32D" unicode="" horiz-adv-x="890"
|
76 |
+
d="M149 -80q-55 0 -94.5 40t-39.5 96v344h174q-4 -28 -4 -50q0 -107 76 -183q77 -77 184 -77q106 0 183 77t77 183q0 26 -6 50h176v-344q0 -56 -39.5 -96t-94.5 -40h-592zM741 780q55 0 94.5 -39t39.5 -95v-146h-218q-78 110 -212 110q-138 0 -212 -110h-218v146
|
77 |
+
q0 56 39.5 95t94.5 39h592zM685 614q0 -9 7.5 -16.5t16.5 -7.5h72q24 0 24 24v72q0 24 -24 24h-72q-24 0 -24 -24v-72zM605 350q0 -65 -47.5 -112.5t-112.5 -47.5t-112.5 47.5t-47.5 112.5q0 67 47 113.5t113 46.5t113 -46.5t47 -113.5z" />
|
78 |
+
</font>
|
79 |
+
</defs></svg>
|
font/fontello.ttf
ADDED
Binary file
|
font/fontello.woff
ADDED
Binary file
|
images/sprite_24x24.png
DELETED
Binary file
|
images/sprite_32x32.png
DELETED
Binary file
|
images/sprite_48x48.png
DELETED
Binary file
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: nathanrice, studiopress
|
3 |
Tags: social media, social networking, social profiles
|
4 |
-
Requires at least: 3.
|
5 |
Tested up to: 3.5.1
|
6 |
-
Stable tag: 0.
|
7 |
|
8 |
-
This plugin
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -22,7 +22,24 @@ Simple Social Icons is an easy to use, customizable way to display icons that li
|
|
22 |
|
23 |
= Can I reorder the icons? =
|
24 |
|
25 |
-
No, not at this time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
== Changelog ==
|
28 |
|
@@ -44,4 +61,7 @@ No, not at this time.
|
|
44 |
* Added bottom margin to icons
|
45 |
|
46 |
= 0.9.5 =
|
47 |
-
* Added Instagram icon
|
|
|
|
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: nathanrice, studiopress
|
3 |
Tags: social media, social networking, social profiles
|
4 |
+
Requires at least: 3.5
|
5 |
Tested up to: 3.5.1
|
6 |
+
Stable tag: 1.0.0
|
7 |
|
8 |
+
This plugin allows you to insert social icons in any widget area.
|
9 |
|
10 |
== Description ==
|
11 |
|
22 |
|
23 |
= Can I reorder the icons? =
|
24 |
|
25 |
+
No, not at this time.
|
26 |
+
|
27 |
+
= Which services are included? =
|
28 |
+
|
29 |
+
* Dribble
|
30 |
+
* Email
|
31 |
+
* Facebook
|
32 |
+
* Flickr
|
33 |
+
* Github
|
34 |
+
* Google+
|
35 |
+
* Instagram
|
36 |
+
* LinkedIn
|
37 |
+
* Pinterest
|
38 |
+
* RSS
|
39 |
+
* StumbleUpon
|
40 |
+
* Twitter
|
41 |
+
* Vimeo
|
42 |
+
* YouTube
|
43 |
|
44 |
== Changelog ==
|
45 |
|
61 |
* Added bottom margin to icons
|
62 |
|
63 |
= 0.9.5 =
|
64 |
+
* Added Instagram icon
|
65 |
+
|
66 |
+
= 1.0.0 =
|
67 |
+
* Switched to icon fonts, rather than images
|
simple-social-icons.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/*
|
3 |
Plugin Name: Simple Social Icons
|
4 |
Plugin URI: http://www.studiopress.com/plugins/simple-social-icons
|
5 |
-
Description: A simple, CSS and
|
6 |
Author: Nathan Rice
|
7 |
Author URI: http://www.nathanrice.net/
|
8 |
|
9 |
-
Version: 0.
|
10 |
|
11 |
License: GNU General Public License v2.0 (or later)
|
12 |
License URI: http://www.opensource.org/licenses/gpl-license.php
|
@@ -46,133 +46,90 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
46 |
* Default widget option values.
|
47 |
*/
|
48 |
$this->defaults = array(
|
49 |
-
'title'
|
50 |
-
'new_window'
|
51 |
-
'size'
|
52 |
-
'border_radius'
|
53 |
-
'
|
|
|
|
|
54 |
'background_color_hover' => '#666666',
|
55 |
-
'alignment'
|
56 |
-
'dribbble'
|
57 |
-
'email'
|
58 |
-
'facebook'
|
59 |
-
'
|
60 |
-
'
|
61 |
-
'
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'
|
66 |
-
'
|
|
|
|
|
|
|
67 |
);
|
68 |
|
69 |
-
/**
|
70 |
-
* Icon sizes.
|
71 |
-
*/
|
72 |
-
$this->sizes = array( '24', '32', '48' );
|
73 |
-
|
74 |
/**
|
75 |
* Social profile choices.
|
76 |
*/
|
77 |
$this->profiles = array(
|
78 |
'dribbble' => array(
|
79 |
-
'label'
|
80 |
-
'pattern'
|
81 |
-
'background_positions' => array(
|
82 |
-
'24' => '0 0',
|
83 |
-
'32' => '0 0',
|
84 |
-
'48' => '0 0',
|
85 |
-
)
|
86 |
),
|
87 |
'email' => array(
|
88 |
-
'label'
|
89 |
-
'pattern'
|
90 |
-
'background_positions' => array(
|
91 |
-
'24' => '-24px 0',
|
92 |
-
'32' => '-32px 0',
|
93 |
-
'48' => '-48px 0',
|
94 |
-
)
|
95 |
),
|
96 |
'facebook' => array(
|
97 |
-
'label'
|
98 |
-
'pattern'
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
104 |
),
|
105 |
'gplus' => array(
|
106 |
-
'label'
|
107 |
-
'pattern'
|
108 |
-
'background_positions' => array(
|
109 |
-
'24' => '-72px 0',
|
110 |
-
'32' => '-96px 0',
|
111 |
-
'48' => '-144px 0',
|
112 |
-
)
|
113 |
),
|
114 |
'instagram' => array(
|
115 |
-
'label'
|
116 |
-
'pattern'
|
117 |
-
'background_positions' => array(
|
118 |
-
'24' => '-240px 0',
|
119 |
-
'32' => '-320px 0',
|
120 |
-
'48' => '-480px 0',
|
121 |
-
)
|
122 |
),
|
123 |
'linkedin' => array(
|
124 |
-
'label'
|
125 |
-
'pattern'
|
126 |
-
'background_positions' => array(
|
127 |
-
'24' => '-96px 0',
|
128 |
-
'32' => '-128px 0',
|
129 |
-
'48' => '-192px 0',
|
130 |
-
)
|
131 |
),
|
132 |
'pinterest' => array(
|
133 |
-
'label'
|
134 |
-
'pattern'
|
135 |
-
'background_positions' => array(
|
136 |
-
'24' => '-120px 0',
|
137 |
-
'32' => '-160px 0',
|
138 |
-
'48' => '-240px 0',
|
139 |
-
)
|
140 |
),
|
141 |
'rss' => array(
|
142 |
-
'label'
|
143 |
-
'pattern'
|
144 |
-
'background_positions' => array(
|
145 |
-
'24' => '-144px 0',
|
146 |
-
'32' => '-192px 0',
|
147 |
-
'48' => '-288px 0',
|
148 |
-
)
|
149 |
),
|
150 |
'stumbleupon' => array(
|
151 |
-
'label'
|
152 |
-
'pattern'
|
153 |
-
'background_positions' => array(
|
154 |
-
'24' => '-168px 0',
|
155 |
-
'32' => '-224px 0',
|
156 |
-
'48' => '-336px 0',
|
157 |
-
)
|
158 |
),
|
159 |
'twitter' => array(
|
160 |
-
'label'
|
161 |
-
'pattern'
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
)
|
167 |
),
|
168 |
'youtube' => array(
|
169 |
-
'label'
|
170 |
-
'pattern'
|
171 |
-
'background_positions' => array(
|
172 |
-
'24' => '-216px 0',
|
173 |
-
'32' => '-288px 0',
|
174 |
-
'48' => '-432px 0',
|
175 |
-
)
|
176 |
),
|
177 |
);
|
178 |
|
@@ -183,12 +140,13 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
183 |
|
184 |
$control_ops = array(
|
185 |
'id_base' => 'simple-social-icons',
|
186 |
-
#'width' => 505,
|
187 |
-
#'height' => 350,
|
188 |
);
|
189 |
|
190 |
$this->WP_Widget( 'simple-social-icons', __( 'Simple Social Icons', 'ssiw' ), $widget_ops, $control_ops );
|
191 |
|
|
|
|
|
|
|
192 |
/** Load CSS in <head> */
|
193 |
add_action( 'wp_head', array( $this, 'css' ) );
|
194 |
|
@@ -210,38 +168,37 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
210 |
|
211 |
<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>
|
212 |
|
213 |
-
<p>
|
214 |
-
<label for="<?php echo $this->get_field_id( 'size' ); ?>"><?php _e( 'Icon Size', 'ssiw' ); ?>:</label>
|
215 |
-
<select id="<?php echo $this->get_field_id( 'size' ); ?>" name="<?php echo $this->get_field_name( 'size' ); ?>">
|
216 |
-
<?php
|
217 |
-
foreach ( (array) $this->sizes as $size ) {
|
218 |
-
printf( '<option value="%d" %s>%dpx</option>', (int) $size, selected( $size, $instance['size'], 0 ), (int) $size );
|
219 |
-
}
|
220 |
-
?>
|
221 |
-
</select>
|
222 |
-
</p>
|
223 |
|
224 |
<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>
|
225 |
|
226 |
-
<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>
|
227 |
-
|
228 |
-
<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>
|
229 |
-
|
230 |
<p>
|
231 |
<label for="<?php echo $this->get_field_id( 'alignment' ); ?>"><?php _e( 'Alignment', 'ssiw' ); ?>:</label>
|
232 |
<select id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
|
233 |
<option value="alignleft" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Left', 'ssiw' ); ?></option>
|
|
|
234 |
<option value="alignright" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Right', 'ssiw' ); ?></option>
|
235 |
</select>
|
236 |
</p>
|
237 |
|
238 |
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
<?php
|
241 |
foreach ( (array) $this->profiles as $profile => $data ) {
|
242 |
|
243 |
-
printf( '<p><label for="%s">%s:</label>', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $data['label'] ) );
|
244 |
-
printf( '<input type="text" id="%s"
|
|
|
245 |
|
246 |
}
|
247 |
|
@@ -257,8 +214,8 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
257 |
|
258 |
foreach ( $newinstance as $key => $value ) {
|
259 |
|
260 |
-
/** Border radius must not be empty, must be a digit */
|
261 |
-
if ( 'border_radius' == $key && ( '' == $value || ! ctype_digit( $value ) ) ) {
|
262 |
$newinstance[$key] = 0;
|
263 |
}
|
264 |
|
@@ -300,7 +257,9 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
300 |
|
301 |
$new_window = $instance['new_window'] ? 'target="_blank"' : '';
|
302 |
|
303 |
-
|
|
|
|
|
304 |
if ( ! empty( $instance[$profile] ) )
|
305 |
$output .= sprintf( $data['pattern'], esc_url( $instance[$profile] ), $new_window );
|
306 |
}
|
@@ -312,6 +271,10 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
312 |
|
313 |
}
|
314 |
|
|
|
|
|
|
|
|
|
315 |
/**
|
316 |
* Custom CSS.
|
317 |
*
|
@@ -323,58 +286,27 @@ class Simple_Social_Icons_Widget extends WP_Widget {
|
|
323 |
$all_instances = $this->get_settings();
|
324 |
$instance = wp_parse_args( $all_instances[$this->number], $this->defaults );
|
325 |
|
326 |
-
|
327 |
-
$
|
328 |
-
'24' => plugin_dir_url( __FILE__ ) . 'images/sprite_24x24.png',
|
329 |
-
'32' => plugin_dir_url( __FILE__ ) . 'images/sprite_32x32.png',
|
330 |
-
'48' => plugin_dir_url( __FILE__ ) . 'images/sprite_48x48.png'
|
331 |
-
);
|
332 |
|
333 |
/** The CSS to output */
|
334 |
-
$css = '
|
335 |
-
overflow: hidden;
|
336 |
-
}
|
337 |
-
.simple-social-icons .alignleft, .simple-social-icons .alignright {
|
338 |
-
margin: 0; padding: 0;
|
339 |
-
}
|
340 |
-
.simple-social-icons ul li {
|
341 |
-
background: none !important;
|
342 |
-
border: none !important;
|
343 |
-
float: left;
|
344 |
-
list-style-type: none !important;
|
345 |
-
margin: 0 5px 10px !important;
|
346 |
-
padding: 0 !important;
|
347 |
-
}
|
348 |
.simple-social-icons ul li a,
|
349 |
.simple-social-icons ul li a:hover {
|
350 |
-
background: ' . $instance['background_color'] . '
|
351 |
-moz-border-radius: ' . $instance['border_radius'] . 'px
|
352 |
-webkit-border-radius: ' . $instance['border_radius'] . 'px;
|
353 |
border-radius: ' . $instance['border_radius'] . 'px;
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
text-indent: -999px;
|
358 |
-
width: ' . $instance['size'] . 'px;
|
359 |
}
|
360 |
|
361 |
.simple-social-icons ul li a:hover {
|
362 |
background-color: ' . $instance['background_color_hover'] . ';
|
|
|
363 |
}';
|
364 |
|
365 |
-
/** Individual Profile button styles */
|
366 |
-
foreach ( (array) $this->profiles as $profile => $data ) {
|
367 |
-
|
368 |
-
if ( ! $instance[$profile] )
|
369 |
-
continue;
|
370 |
-
|
371 |
-
$css .= '.simple-social-icons ul li.social-' . $profile . ' a,
|
372 |
-
.simple-social-icons ul li.social-' . $profile . ' a:hover {
|
373 |
-
background-position: ' . $data['background_positions'][$instance['size']] . ';
|
374 |
-
}';
|
375 |
-
|
376 |
-
}
|
377 |
-
|
378 |
/** Minify a bit */
|
379 |
$css = str_replace( "\t", '', $css );
|
380 |
$css = str_replace( array( "\n", "\r" ), ' ', $css );
|
@@ -397,4 +329,4 @@ function ssiw_load_widget() {
|
|
397 |
|
398 |
register_widget( 'Simple_Social_Icons_Widget' );
|
399 |
|
400 |
-
}
|
2 |
/*
|
3 |
Plugin Name: Simple Social Icons
|
4 |
Plugin URI: http://www.studiopress.com/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.0
|
10 |
|
11 |
License: GNU General Public License v2.0 (or later)
|
12 |
License URI: http://www.opensource.org/licenses/gpl-license.php
|
46 |
* Default widget option values.
|
47 |
*/
|
48 |
$this->defaults = array(
|
49 |
+
'title' => '',
|
50 |
+
'new_window' => 0,
|
51 |
+
'size' => 36,
|
52 |
+
'border_radius' => 3,
|
53 |
+
'icon_color' => '#ffffff',
|
54 |
+
'icon_color_hover' => '#ffffff',
|
55 |
+
'background_color' => '#999999',
|
56 |
'background_color_hover' => '#666666',
|
57 |
+
'alignment' => 'alignleft',
|
58 |
+
'dribbble' => '',
|
59 |
+
'email' => '',
|
60 |
+
'facebook' => '',
|
61 |
+
'flickr' => '',
|
62 |
+
'github' => '',
|
63 |
+
'gplus' => '',
|
64 |
+
'instagram' => '',
|
65 |
+
'linkedin' => '',
|
66 |
+
'pinterest' => '',
|
67 |
+
'rss' => '',
|
68 |
+
'stumbleupon' => '',
|
69 |
+
'twitter' => '',
|
70 |
+
'vimeo' => '',
|
71 |
+
'youtube' => '',
|
72 |
);
|
73 |
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* Social profile choices.
|
76 |
*/
|
77 |
$this->profiles = array(
|
78 |
'dribbble' => array(
|
79 |
+
'label' => __( 'Dribbble URI', 'ssiw' ),
|
80 |
+
'pattern' => '<li class="social-dribbble"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
81 |
),
|
82 |
'email' => array(
|
83 |
+
'label' => __( 'Email URI', 'ssiw' ),
|
84 |
+
'pattern' => '<li class="social-email"><a href="%s" %s>✉</a></li>',
|
|
|
|
|
|
|
|
|
|
|
85 |
),
|
86 |
'facebook' => array(
|
87 |
+
'label' => __( 'Facebook URI', 'ssiw' ),
|
88 |
+
'pattern' => '<li class="social-facebook"><a href="%s" %s></a></li>',
|
89 |
+
),
|
90 |
+
'flickr' => array(
|
91 |
+
'label' => __( 'Flickr URI', 'ssiw' ),
|
92 |
+
'pattern' => '<li class="social-flickr"><a href="%s" %s></a></li>',
|
93 |
+
),
|
94 |
+
'github' => array(
|
95 |
+
'label' => __( 'GitHub URI', 'ssiw' ),
|
96 |
+
'pattern' => '<li class="social-github"><a href="%s" %s></a></li>',
|
97 |
),
|
98 |
'gplus' => array(
|
99 |
+
'label' => __( 'Google+ URI', 'ssiw' ),
|
100 |
+
'pattern' => '<li class="social-gplus"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
101 |
),
|
102 |
'instagram' => array(
|
103 |
+
'label' => __( 'Instagram URI', 'ssiw' ),
|
104 |
+
'pattern' => '<li class="social-instagram"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
105 |
),
|
106 |
'linkedin' => array(
|
107 |
+
'label' => __( 'Linkedin URI', 'ssiw' ),
|
108 |
+
'pattern' => '<li class="social-linkedin"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
109 |
),
|
110 |
'pinterest' => array(
|
111 |
+
'label' => __( 'Pinterest URI', 'ssiw' ),
|
112 |
+
'pattern' => '<li class="social-pinterest"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
113 |
),
|
114 |
'rss' => array(
|
115 |
+
'label' => __( 'RSS URI', 'ssiw' ),
|
116 |
+
'pattern' => '<li class="social-rss"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
117 |
),
|
118 |
'stumbleupon' => array(
|
119 |
+
'label' => __( 'StumbleUpon URI', 'ssiw' ),
|
120 |
+
'pattern' => '<li class="social-stumbleupon"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
121 |
),
|
122 |
'twitter' => array(
|
123 |
+
'label' => __( 'Twitter URI', 'ssiw' ),
|
124 |
+
'pattern' => '<li class="social-twitter"><a href="%s" %s></a></li>',
|
125 |
+
),
|
126 |
+
'vimeo' => array(
|
127 |
+
'label' => __( 'Vimeo URI', 'ssiw' ),
|
128 |
+
'pattern' => '<li class="social-vimeo"><a href="%s" %s></a></li>',
|
|
|
129 |
),
|
130 |
'youtube' => array(
|
131 |
+
'label' => __( 'YouTube URI', 'ssiw' ),
|
132 |
+
'pattern' => '<li class="social-youtube"><a href="%s" %s></a></li>',
|
|
|
|
|
|
|
|
|
|
|
133 |
),
|
134 |
);
|
135 |
|
140 |
|
141 |
$control_ops = array(
|
142 |
'id_base' => 'simple-social-icons',
|
|
|
|
|
143 |
);
|
144 |
|
145 |
$this->WP_Widget( 'simple-social-icons', __( 'Simple Social Icons', 'ssiw' ), $widget_ops, $control_ops );
|
146 |
|
147 |
+
/** Enqueue icon font */
|
148 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ) );
|
149 |
+
|
150 |
/** Load CSS in <head> */
|
151 |
add_action( 'wp_head', array( $this, 'css' ) );
|
152 |
|
168 |
|
169 |
<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>
|
170 |
|
171 |
+
<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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
<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>
|
174 |
|
|
|
|
|
|
|
|
|
175 |
<p>
|
176 |
<label for="<?php echo $this->get_field_id( 'alignment' ); ?>"><?php _e( 'Alignment', 'ssiw' ); ?>:</label>
|
177 |
<select id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
|
178 |
<option value="alignleft" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Left', 'ssiw' ); ?></option>
|
179 |
+
<option value="aligncenter" <?php selected( 'aligncenter', $instance['alignment'] ) ?>><?php _e( 'Align Center', 'ssiw' ); ?></option>
|
180 |
<option value="alignright" <?php selected( 'alignright', $instance['alignment'] ) ?>><?php _e( 'Align Right', 'ssiw' ); ?></option>
|
181 |
</select>
|
182 |
</p>
|
183 |
|
184 |
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
|
185 |
|
186 |
+
<p><label for="<?php echo $this->get_field_id( 'background_color' ); ?>"><?php _e( 'Icon Font Color:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'icon_color' ); ?>" name="<?php echo $this->get_field_name( 'icon_color' ); ?>" type="text" value="<?php echo esc_attr( $instance['icon_color'] ); ?>" size="6" /></p>
|
187 |
+
|
188 |
+
<p><label for="<?php echo $this->get_field_id( 'background_color_hover' ); ?>"><?php _e( 'Icon Font Hover Color:', 'ssiw' ); ?></label> <input id="<?php echo $this->get_field_id( 'icon_color_hover' ); ?>" name="<?php echo $this->get_field_name( 'icon_color_hover' ); ?>" type="text" value="<?php echo esc_attr( $instance['icon_color_hover'] ); ?>" size="6" /></p>
|
189 |
+
|
190 |
+
<p><label for="<?php echo $this->get_field_id( 'background_color' ); ?>"><?php _e( 'Background 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="6" /></p>
|
191 |
+
|
192 |
+
<p><label for="<?php echo $this->get_field_id( 'background_color_hover' ); ?>"><?php _e( 'Background 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="6" /></p>
|
193 |
+
|
194 |
+
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;" />
|
195 |
+
|
196 |
<?php
|
197 |
foreach ( (array) $this->profiles as $profile => $data ) {
|
198 |
|
199 |
+
printf( '<p><label for="%s">%s:</label></p>', esc_attr( $this->get_field_id( $profile ) ), esc_attr( $data['label'] ) );
|
200 |
+
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] ) );
|
201 |
+
printf( '</p>' );
|
202 |
|
203 |
}
|
204 |
|
214 |
|
215 |
foreach ( $newinstance as $key => $value ) {
|
216 |
|
217 |
+
/** Border radius and Icon size must not be empty, must be a digit */
|
218 |
+
if ( ( 'border_radius' == $key || 'size' == $key ) && ( '' == $value || ! ctype_digit( $value ) ) ) {
|
219 |
$newinstance[$key] = 0;
|
220 |
}
|
221 |
|
257 |
|
258 |
$new_window = $instance['new_window'] ? 'target="_blank"' : '';
|
259 |
|
260 |
+
$profiles = (array) $this->profiles;
|
261 |
+
|
262 |
+
foreach ( $profiles as $profile => $data ) {
|
263 |
if ( ! empty( $instance[$profile] ) )
|
264 |
$output .= sprintf( $data['pattern'], esc_url( $instance[$profile] ), $new_window );
|
265 |
}
|
271 |
|
272 |
}
|
273 |
|
274 |
+
function enqueue_css() {
|
275 |
+
wp_enqueue_style( 'simple-social-icons-font', plugin_dir_url( __FILE__ ) . '/css/style.css', array(), '1.0.0' );
|
276 |
+
}
|
277 |
+
|
278 |
/**
|
279 |
* Custom CSS.
|
280 |
*
|
286 |
$all_instances = $this->get_settings();
|
287 |
$instance = wp_parse_args( $all_instances[$this->number], $this->defaults );
|
288 |
|
289 |
+
$font_size = round( (int) $instance['size'] / 2 );
|
290 |
+
$icon_padding = round ( (int) $font_size / 2 );
|
|
|
|
|
|
|
|
|
291 |
|
292 |
/** The CSS to output */
|
293 |
+
$css = '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
.simple-social-icons ul li a,
|
295 |
.simple-social-icons ul li a:hover {
|
296 |
+
background: ' . $instance['background_color'] . ';
|
297 |
-moz-border-radius: ' . $instance['border_radius'] . 'px
|
298 |
-webkit-border-radius: ' . $instance['border_radius'] . 'px;
|
299 |
border-radius: ' . $instance['border_radius'] . 'px;
|
300 |
+
color: ' . $instance['icon_color'] . ';
|
301 |
+
font-size: ' . $font_size . 'px;
|
302 |
+
padding: ' . $icon_padding . 'px;
|
|
|
|
|
303 |
}
|
304 |
|
305 |
.simple-social-icons ul li a:hover {
|
306 |
background-color: ' . $instance['background_color_hover'] . ';
|
307 |
+
color: ' . $instance['icon_color_hover'] . ';
|
308 |
}';
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
/** Minify a bit */
|
311 |
$css = str_replace( "\t", '', $css );
|
312 |
$css = str_replace( array( "\n", "\r" ), ' ', $css );
|
329 |
|
330 |
register_widget( 'Simple_Social_Icons_Widget' );
|
331 |
|
332 |
+
}
|