Version Description
- Test with WordPress 5.9.1.
- Clean up and sanitize things.
Download this release
Release Info
Developer | DavidoffNeal |
Plugin | Simple Share Buttons Adder |
Version | 8.2.4 |
Comparing to | |
See all releases |
Code changes from version 8.2.3 to 8.2.4
- instance.php +1 -1
- js/ssba.js +29 -20
- php/class-admin-bits.php +576 -544
- php/class-admin-panel.php +1821 -1785
- php/class-buttons.php +2370 -2323
- php/class-database.php +680 -692
- php/class-forms.php +243 -245
- php/class-plugin-base.php +42 -36
- php/class-plugin.php +194 -89
- php/class-simple-share-buttons-adder.php +105 -108
- php/class-styles.php +244 -241
- php/class-widget.php +13 -13
- readme.txt +7 -2
- simple-share-buttons-adder.php +9 -1
- templates/admin-footer.php +18 -16
- templates/admin-header.php +13 -1
- templates/admin-panel.php +21 -36
- templates/classic-tab.php +55 -50
- templates/config/gdpr/appearance.php +47 -41
- templates/config/gdpr/config.php +71 -61
- templates/config/gdpr/landing.php +279 -223
- templates/config/gdpr/purposes.php +206 -179
- templates/config/gdpr/register.php +32 -27
- templates/gdpr-tab.php +33 -24
- templates/plus-tab.php +51 -47
- templates/share-bar-tab.php +56 -41
instance.php
CHANGED
@@ -9,7 +9,7 @@ namespace SimpleShareButtonsAdder;
|
|
9 |
|
10 |
define( 'SSBA_FILE', __FILE__ );
|
11 |
define( 'SSBA_ROOT', dirname( __FILE__ ) );
|
12 |
-
define( 'SSBA_VERSION', '8.2.
|
13 |
|
14 |
global $simple_share_buttons_adder_plugin;
|
15 |
|
9 |
|
10 |
define( 'SSBA_FILE', __FILE__ );
|
11 |
define( 'SSBA_ROOT', dirname( __FILE__ ) );
|
12 |
+
define( 'SSBA_VERSION', '8.2.4' );
|
13 |
|
14 |
global $simple_share_buttons_adder_plugin;
|
15 |
|
js/ssba.js
CHANGED
@@ -22,9 +22,11 @@ var Main = ( function( $, FB ) {
|
|
22 |
boot: function( data ) {
|
23 |
this.data = data;
|
24 |
|
25 |
-
$( document ).ready(
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
},
|
29 |
|
30 |
/**
|
@@ -42,12 +44,16 @@ var Main = ( function( $, FB ) {
|
|
42 |
var self = this;
|
43 |
|
44 |
// Upon clicking a share button.
|
45 |
-
$( 'body' ).on(
|
|
|
|
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
},
|
52 |
|
53 |
/**
|
@@ -59,11 +65,14 @@ var Main = ( function( $, FB ) {
|
|
59 |
|
60 |
// If it's facebook mobile.
|
61 |
if ( 'mobile' === $( event ).data( 'facebook' ) ) {
|
62 |
-
FB.ui(
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
67 |
} else {
|
68 |
|
69 |
// These share options don't need to have a popup.
|
@@ -76,13 +85,13 @@ var Main = ( function( $, FB ) {
|
|
76 |
// Prepare popup window.
|
77 |
var width = 575,
|
78 |
height = 520,
|
79 |
-
left
|
80 |
-
top
|
81 |
-
opts
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
// Open the share url in a smaller window.
|
88 |
window.open( $( event ).attr( 'href' ), 'share', opts );
|
22 |
boot: function( data ) {
|
23 |
this.data = data;
|
24 |
|
25 |
+
$( document ).ready(
|
26 |
+
function() {
|
27 |
+
this.init();
|
28 |
+
}.bind( this )
|
29 |
+
);
|
30 |
},
|
31 |
|
32 |
/**
|
44 |
var self = this;
|
45 |
|
46 |
// Upon clicking a share button.
|
47 |
+
$( 'body' ).on(
|
48 |
+
'click',
|
49 |
+
'.ssbp-wrap a',
|
50 |
+
function( event ) {
|
51 |
|
52 |
+
// Don't go the the href yet.
|
53 |
+
event.preventDefault();
|
54 |
+
self.engageShareButton( this );
|
55 |
+
}
|
56 |
+
);
|
57 |
},
|
58 |
|
59 |
/**
|
65 |
|
66 |
// If it's facebook mobile.
|
67 |
if ( 'mobile' === $( event ).data( 'facebook' ) ) {
|
68 |
+
FB.ui(
|
69 |
+
{
|
70 |
+
method: 'share',
|
71 |
+
mobile_iframe: true,
|
72 |
+
href: $( event ).data( 'href' )
|
73 |
+
},
|
74 |
+
function( response ) {}
|
75 |
+
);
|
76 |
} else {
|
77 |
|
78 |
// These share options don't need to have a popup.
|
85 |
// Prepare popup window.
|
86 |
var width = 575,
|
87 |
height = 520,
|
88 |
+
left = ( $( window ).width() - width ) / 2,
|
89 |
+
top = ( $( window ).height() - height ) / 2,
|
90 |
+
opts = 'status=1' +
|
91 |
+
',width=' + width +
|
92 |
+
',height=' + height +
|
93 |
+
',top=' + top +
|
94 |
+
',left=' + left;
|
95 |
|
96 |
// Open the share url in a smaller window.
|
97 |
window.open( $( event ).attr( 'href' ), 'share', opts );
|
php/class-admin-bits.php
CHANGED
@@ -12,236 +12,253 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Admin_Bits
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
86 |
<span class="button button-primary">
|
87 |
-
<?php echo esc_html__('I accept', 'simple-share-buttons-adder'); ?>
|
88 |
</span>
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
right: auto !important;
|
230 |
border-radius: 0 5px 5px 0; }';
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
return "@font-face {
|
245 |
font-family: 'ssbp';
|
246 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?xj3ol1');
|
247 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?#iefixxj3ol1') format('embedded-opentype'),
|
@@ -255,322 +272,337 @@ class Admin_Bits
|
|
255 |
-webkit-font-smoothing: antialiased;
|
256 |
-moz-osx-font-smoothing: grayscale;
|
257 |
}";
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Admin_Bits {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Plugin instance.
|
19 |
+
*
|
20 |
+
* @var object
|
21 |
+
*/
|
22 |
+
public $plugin;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Simple_Share_Buttons_Adder instance.
|
26 |
+
*
|
27 |
+
* @var object
|
28 |
+
*/
|
29 |
+
public $class_ssba;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Database instance.
|
33 |
+
*
|
34 |
+
* @var object
|
35 |
+
*/
|
36 |
+
public $database;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Admin Panel instance.
|
40 |
+
*
|
41 |
+
* @var object
|
42 |
+
*/
|
43 |
+
public $admin_panel;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Class constructor.
|
47 |
+
*
|
48 |
+
* @param object $plugin Plugin class.
|
49 |
+
* @param object $class_ssba Simple Share Buttons Adder class.
|
50 |
+
* @param object $database Database class.
|
51 |
+
* @param Admin_Panel $admin_panel Admin Panel class.
|
52 |
+
*/
|
53 |
+
public function __construct( $plugin, $class_ssba, $database, $admin_panel ) {
|
54 |
+
$this->plugin = $plugin;
|
55 |
+
$this->class_ssba = $class_ssba;
|
56 |
+
$this->database = $database;
|
57 |
+
$this->admin_panel = $admin_panel;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* ShareThis terms notice detector.
|
62 |
+
*/
|
63 |
+
public static function sharethis_terms_notice() {
|
64 |
+
$arr_settings = get_option( 'ssba_settings', true );
|
65 |
+
|
66 |
+
// If the sharethis terms have not yet been accepted.
|
67 |
+
if ( true === isset( $arr_settings['accepted_sharethis_terms'] ) && 'Y' !== $arr_settings['accepted_sharethis_terms'] ) {
|
68 |
+
?>
|
69 |
+
<div id="sharethis_terms_notice" class="update-nag notice is-dismissible">
|
70 |
+
<p>
|
71 |
+
<?php esc_html_e( 'We\'ve updated our', 'simple-share-buttons-adder' ); ?>
|
72 |
+
<a style="text-decoration: underline;" href="http://simplesharebuttons.com/privacy" target="_blank">
|
73 |
+
<?php
|
74 |
+
echo esc_html__(
|
75 |
+
'privacy policy and terms of use ',
|
76 |
+
'simple-share-buttons-adder'
|
77 |
+
);
|
78 |
+
?>
|
79 |
+
</a>
|
80 |
+
<?php
|
81 |
+
echo esc_html__(
|
82 |
+
'with important changes you should review. To take advantage of the new features, please review and accept the new ',
|
83 |
+
'simple-share-buttons-adder'
|
84 |
+
);
|
85 |
+
?>
|
86 |
+
<a style="text-decoration: underline;" href="http://simplesharebuttons.com/privacy" target="_blank">
|
87 |
+
<?php esc_html_e( 'terms and privacy policy', 'simple-share-button-adder' ); ?>
|
88 |
+
</a>.
|
89 |
+
<a href="options-general.php?page=simple-share-buttons-adder&accept-terms=Y">
|
90 |
<span class="button button-primary">
|
91 |
+
<?php echo esc_html__( 'I accept', 'simple-share-buttons-adder' ); ?>
|
92 |
</span>
|
93 |
+
</a>
|
94 |
+
</p>
|
95 |
+
</div>
|
96 |
+
<?php
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Add settings link on plugin page.
|
102 |
+
*
|
103 |
+
* @filter plugin_action_links_simple-share-buttons-adder
|
104 |
+
*
|
105 |
+
* @param array $links The supplied links.
|
106 |
+
*
|
107 |
+
* @return mixed
|
108 |
+
*/
|
109 |
+
public function ssba_settings_link( $links ) {
|
110 |
+
// Add to plugins links.
|
111 |
+
array_unshift(
|
112 |
+
$links,
|
113 |
+
'<a href="options-general.php?page=simple-share-buttons-adder">'
|
114 |
+
. esc_html__( 'Settings', 'simple-share-buttons-adder' )
|
115 |
+
. '</a>'
|
116 |
+
);
|
117 |
+
|
118 |
+
return $links;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* AJAX Call for adding hide option to review popup.
|
123 |
+
*
|
124 |
+
* @action wp_ajax_ssba_ajax_hide_review
|
125 |
+
*
|
126 |
+
* @param mixed $post Post.
|
127 |
+
*/
|
128 |
+
public function ssba_ajax_hide_review( $post ) {
|
129 |
+
update_option( 'ssba-hide-review', true );
|
130 |
+
|
131 |
+
wp_send_json_success( 'hidden' );
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* AJAX Call for saving property id and token.
|
136 |
+
*
|
137 |
+
* @action wp_ajax_ssba_ajax_add_creds
|
138 |
+
*/
|
139 |
+
public function ssba_ajax_add_creds() {
|
140 |
+
check_ajax_referer( $this->plugin->meta_prefix, 'nonce' );
|
141 |
+
|
142 |
+
$property_id = filter_input( INPUT_POST, 'propertyId', FILTER_SANITIZE_STRING );
|
143 |
+
|
144 |
+
$token = filter_input( INPUT_POST, 'token', FILTER_SANITIZE_STRING );
|
145 |
+
|
146 |
+
if ( true === empty( $property_id )
|
147 |
+
|| true === empty( $token )
|
148 |
+
|| in_array( '', array( $property_id, $token ), true )
|
149 |
+
) {
|
150 |
+
wp_send_json_error( 'Property Creation Failed.' );
|
151 |
+
}
|
152 |
+
|
153 |
+
$property_id = sanitize_text_field( wp_unslash( $property_id ) );
|
154 |
+
$token = sanitize_text_field( wp_unslash( $token ) );
|
155 |
+
|
156 |
+
update_option( 'ssba_property_id', $property_id );
|
157 |
+
update_option( 'ssba_token', $token );
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Includes js/css files and upload script.
|
162 |
+
*
|
163 |
+
* @param string $hook_suffix The current admin page hook suffix.
|
164 |
+
*
|
165 |
+
* @action admin_enqueue_scripts
|
166 |
+
*/
|
167 |
+
public function enqueue_admin_assets( $hook_suffix ) {
|
168 |
+
$current_url = $this->plugin->dir_url . 'buttons/';
|
169 |
+
|
170 |
+
if ( $this->hook_suffix === $hook_suffix ) {
|
171 |
+
// All extra scripts needed.
|
172 |
+
wp_enqueue_media();
|
173 |
+
wp_enqueue_script( 'media-upload' );
|
174 |
+
wp_enqueue_script( 'jquery-ui-sortable' );
|
175 |
+
wp_enqueue_script( 'jquery-ui' );
|
176 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-bootstrap-js" );
|
177 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-colorpicker" );
|
178 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-switch" );
|
179 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-admin" );
|
180 |
+
|
181 |
+
// Get sbba settings.
|
182 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
183 |
+
$token = get_option( 'ssba_token' );
|
184 |
+
$propertyid = get_option( 'ssba_property_id' );
|
185 |
+
|
186 |
+
wp_add_inline_script(
|
187 |
+
"{$this->plugin->assets_prefix}-admin",
|
188 |
+
sprintf(
|
189 |
+
'%s.boot( %s );',
|
190 |
+
__NAMESPACE__,
|
191 |
+
wp_json_encode(
|
192 |
+
array(
|
193 |
+
'site' => $current_url,
|
194 |
+
'homeUrl' => str_replace( array( 'https://', 'http://' ), '', get_home_url() ),
|
195 |
+
'nonce' => wp_create_nonce( $this->plugin->meta_prefix ),
|
196 |
+
'publisher_purposes' => ! empty( $arr_settings['ssba_gdpr_config']['publisher_purposes'] ) ? $arr_settings['ssba_gdpr_config']['publisher_purposes'] : false,
|
197 |
+
'publisher_restrictions' => ! empty( $arr_settings['ssba_gdpr_config']['publisher_restrictions'] ) ? $arr_settings['ssba_gdpr_config']['publisher_restrictions'] : false,
|
198 |
+
'token' => ! empty( $token ) ? $token : false,
|
199 |
+
'propertyid' => ! empty( $propertyid ) ? $propertyid : false,
|
200 |
+
)
|
201 |
+
)
|
202 |
+
)
|
203 |
+
);
|
204 |
+
|
205 |
+
$custom_css = ! empty( $arr_settings['ssba_additional_css'] ) ? $arr_settings['ssba_additional_css'] : '';
|
206 |
+
$custom_css .= ! empty( $arr_settings['ssba_plus_additional_css'] ) ? $arr_settings['ssba_plus_additional_css'] : '';
|
207 |
+
$custom_css .= ! empty( $arr_settings['ssba_bar_additional_css'] ) ? $arr_settings['ssba_bar_additional_css'] : '';
|
208 |
+
|
209 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-admin-theme", $custom_css );
|
210 |
+
|
211 |
+
// Admin styles.
|
212 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-readable" );
|
213 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-colorpicker" );
|
214 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-switch" );
|
215 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-font-awesome" );
|
216 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-admin-theme" );
|
217 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-admin" );
|
218 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-styles" );
|
219 |
+
|
220 |
+
$html_share_buttons_form = '';
|
221 |
+
|
222 |
+
// Get settings.
|
223 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
224 |
+
|
225 |
+
$accept_terms = filter_input( INPUT_GET, 'accept-terms', FILTER_SANITIZE_STRING );
|
226 |
+
|
227 |
+
// If user is accepting terms.
|
228 |
+
if ( 'Y' === $accept_terms ) {
|
229 |
+
// Save acceptance.
|
230 |
+
$this->class_ssba->ssba_update_options(
|
231 |
+
array(
|
232 |
+
'accepted_sharethis_terms' => 'Y',
|
233 |
+
)
|
234 |
+
);
|
235 |
+
|
236 |
+
// Hide the notice for now, it will disappear upon reload.
|
237 |
+
$html_share_buttons_form .= '#sharethis_terms_notice { display: none }.ssbp-facebook_save { background-color: #365397 !important; }';
|
238 |
+
}
|
239 |
+
|
240 |
+
// Get the font family needed.
|
241 |
+
$html_share_buttons_form .= $this->get_font_family();
|
242 |
+
|
243 |
+
// If left to right.
|
244 |
+
if ( true === is_rtl() ) {
|
245 |
+
// Move save button.
|
246 |
+
$html_share_buttons_form .= '.ssba-btn-save{ left: 0!important;
|
247 |
right: auto !important;
|
248 |
border-radius: 0 5px 5px 0; }';
|
249 |
+
}
|
250 |
+
|
251 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-admin-theme", $html_share_buttons_form );
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Get ssbp font family.
|
257 |
+
*
|
258 |
+
* @return string
|
259 |
+
*/
|
260 |
+
private function get_font_family() {
|
261 |
+
return "@font-face {
|
|
|
262 |
font-family: 'ssbp';
|
263 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?xj3ol1');
|
264 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?#iefixxj3ol1') format('embedded-opentype'),
|
272 |
-webkit-font-smoothing: antialiased;
|
273 |
-moz-osx-font-smoothing: grayscale;
|
274 |
}";
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Save dismiss notice status.
|
279 |
+
*
|
280 |
+
* @action wp_ajax_dismiss_notice
|
281 |
+
*/
|
282 |
+
public function dismiss_notice() {
|
283 |
+
check_ajax_referer( $this->plugin->meta_prefix, 'nonce' );
|
284 |
+
|
285 |
+
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_STRING );
|
286 |
+
$type = sanitize_text_field( wp_unslash( $type ) );
|
287 |
+
|
288 |
+
if ( true === empty( $type ) ) {
|
289 |
+
wp_send_json_error( 'dismiss notice failed' );
|
290 |
+
}
|
291 |
+
|
292 |
+
$current_notices = get_option( 'ssba_dismiss_notice' );
|
293 |
+
$current_notices = null !== $current_notices && false !== $current_notices && '' !== $current_notices ? $current_notices : '';
|
294 |
+
|
295 |
+
if ( '' !== $current_notices ) {
|
296 |
+
$new_notice = array_merge(
|
297 |
+
$current_notices,
|
298 |
+
array(
|
299 |
+
$type => false,
|
300 |
+
)
|
301 |
+
);
|
302 |
+
} else {
|
303 |
+
$new_notice = array(
|
304 |
+
$type => false,
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
update_option( 'ssba_dismiss_notice', $new_notice );
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Save dismiss notice status.
|
313 |
+
*
|
314 |
+
* @action wp_ajax_ssba_ajax_update_gdpr
|
315 |
+
*/
|
316 |
+
public function update_gdpr() {
|
317 |
+
check_ajax_referer( $this->plugin->meta_prefix, 'nonce' );
|
318 |
+
|
319 |
+
$config = filter_input( INPUT_POST, 'config', FILTER_DEFAULT );
|
320 |
+
|
321 |
+
if ( true === empty( $config ) ) {
|
322 |
+
wp_send_json_error( 'gdpr update fail' );
|
323 |
+
}
|
324 |
+
|
325 |
+
$current_settings = get_option( 'ssba_settings' );
|
326 |
+
$current_settings = false === empty( $current_settings ) ? $current_settings : '';
|
327 |
+
|
328 |
+
if ( '' === $current_settings ) {
|
329 |
+
wp_send_json_error( 'no settings' );
|
330 |
+
}
|
331 |
+
|
332 |
+
$current_settings['ssba_gdpr_config'] = $config;
|
333 |
+
|
334 |
+
update_option( 'ssba_settings', $current_settings );
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Register the new simple share button adder menu dashboard link.
|
339 |
+
*
|
340 |
+
* @action admin_menu
|
341 |
+
*/
|
342 |
+
public function add_ssba_menu() {
|
343 |
+
$icon = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMjcyLjAwMDAwMHB0IiBoZWlnaHQ9IjIzNi4wMDAwMDBwdCIgdmlld0JveD0iMCAwIDI3Mi4wMDAwMDAgMjM2LjAwMDAwMCIKIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgoKPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMjM2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTk3NSAyMjkzIGMtMTQwIC0xNiAtMjQ2IC00OCAtMzY5IC0xMTEgLTI3NSAtMTQxIC00NjEgLTM5MCAtNTI3Ci03MDcgLTE2IC03NyAtMTYgLTI4MyAwIC0zNjAgODIgLTM5NCAzNTkgLTY5MSA3MzcgLTc5MCAxNjQgLTQzIDM1MSAtNDEgNTI2CjYgMTE0IDMxIDExNSAzMiA4NyAxMTAgLTEyIDM1IC0yMyA2NSAtMjQgNjYgLTEgMiAtMjUgLTYgLTUzIC0xNyAtMTE1IC00NAotMjkxIC02MCAtNDIyIC00MCAtMjg3IDQ2IC01MjUgMjI2IC02NDkgNDkyIC01MyAxMTEgLTcwIDE4MyAtNzggMzA4IC0xNCAyNDgKNjYgNDY1IDIzNSA2NDIgMTc5IDE4OCA0MDMgMjc3IDY2MSAyNjUgNjQgLTMgMTQxIC0xMiAxNzEgLTIwIDI1MyAtNzAgNDQxCi0yMTkgNTU4IC00NDUgNDcgLTg5IDkyIC0yNDcgOTIgLTMyMCBsMCAtNDUgNTMgNyBjMjggMyA2MyA2IDc2IDYgMjMgMCAyMyAxCjE3IDYzIC0xNyAxNTIgLTkzIDM1MyAtMTgwIDQ3MiAtOTQgMTMwIC0yNTcgMjY0IC00MDAgMzMwIC0xNTIgNzEgLTM1OSAxMDYKLTUxMSA4OHoiLz4KPHBhdGggZD0iTTg3MCAyMDcwIGMtMjIxIC01OSAtNDA5IC0yMDYgLTUwOSAtNDAwIC02MiAtMTE5IC04MiAtMTk4IC04OCAtMzM1Ci01IC0xMzMgOCAtMjIwIDUwIC0zMjUgNzkgLTE5NCAyNTAgLTM2NyA0NDAgLTQ0MyAxNjcgLTY3IDM3NiAtNzUgNTM3IC0yMQpsODUgMjkgNiAxMTAgYzE2IDI2NiAxNDYgNDY4IDM3NiA1ODIgbDkyIDQ2IC01IDUxIGMtMzMgMzI1IC0yNDIgNTg5IC01NDkKNjkyIC02OCAyMiAtMTAxIDI3IC0yMjAgMzAgLTExNyAzIC0xNTMgMSAtMjE1IC0xNnogbTU4IC01MjUgYzM4IC0zMiA0OCAtNzIKMjggLTExOCAtNDUgLTEwOCAtMTk1IC03NiAtMTk2IDQxIDAgOTAgOTkgMTM1IDE2OCA3N3ogbTM3MiAxMCBjMzcgLTE5IDUwCi00MyA1MCAtOTUgMCAtNTcgLTQyIC0xMDAgLTk3IC0xMDAgLTEwMSAwIC0xNDggMTIwIC03MiAxODQgMzUgMzAgNzYgMzMgMTE5CjExeiBtLTM2MCAtNDEyIGM0MiAtMzkgNDkgLTg3IDE4IC0xMzMgLTM5IC01OCAtMTE0IC02NSAtMTY0IC0xNSAtMTggMTkgLTI0CjM1IC0yNCA3MCAwIDk1IDEwMCAxNDAgMTcwIDc4eiBtMzY5IDEzIGM1OCAtMzAgNjkgLTExOSAyMiAtMTY3IC0yMyAtMjMgLTM4Ci0yOSAtNzEgLTI5IC0zNSAwIC00OCA2IC03NyAzNSAtMzIgMzIgLTM1IDQwIC0zMCA3NiAxMSA4MSA4NSAxMjEgMTU2IDg1eiIvPgo8cGF0aCBkPSJNMTkxMiAxMjUwIGMtMTEwIC0yOSAtMTg3IC03NSAtMjczIC0xNjAgLTEyMiAtMTIwIC0xNzkgLTI1NiAtMTc5Ci00MjUgMCAtMTcwIDU3IC0zMDMgMTgxIC00MjYgMzQwIC0zNDAgOTA5IC0xNjggMTAxNCAzMDUgNjUgMjkyIC0xMDggNTkyCi0zOTcgNjkzIC0xMDIgMzUgLTI0NSA0MSAtMzQ2IDEzeiBtMTk4IC0zNjkgYzUgLTExIDEwIC00OSAxMCAtODUgbDAgLTY2IDc3CjAgYzg5IDAgMTEzIC0xNCAxMTMgLTY2IDAgLTQ4IC0yOCAtNjQgLTExNyAtNjQgbC03MyAwIDAgLTgyIGMwIC05MCAtMTQgLTExOAotNTcgLTExOCAtNTUgMCAtNjMgMTMgLTYzIDExMCBsMCA5MCAtNzMgMCBjLTg5IDAgLTExNyAxNSAtMTE3IDY1IDAgNTMgMjAgNjUKMTExIDY1IGw3OSAwIDAgNzMgYzAgNDMgNSA3OCAxMiA4NSAyMCAyMCA4NiAxNSA5OCAtN3oiLz4KPC9nPgo8L3N2Zz4K';
|
344 |
+
|
345 |
+
add_menu_page(
|
346 |
+
'Simple Share Buttons Adder',
|
347 |
+
'Simple Share Buttons',
|
348 |
+
'manage_options',
|
349 |
+
'simple-share-buttons-adder',
|
350 |
+
array( $this, 'ssba_settings' ),
|
351 |
+
$icon,
|
352 |
+
26
|
353 |
+
);
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Menu settings.
|
358 |
+
*
|
359 |
+
* @action admin_menu
|
360 |
+
*/
|
361 |
+
public function ssba_menu() {
|
362 |
+
// Add menu page.
|
363 |
+
$this->hook_suffix = add_options_page(
|
364 |
+
esc_html__( 'Simple Share Buttons Adder', 'simple-share-buttons-adder' ),
|
365 |
+
esc_html__( 'Simple Share Buttons', 'simple-share-buttons-adder' ),
|
366 |
+
'manage_options',
|
367 |
+
$this->plugin->assets_prefix,
|
368 |
+
array( $this, 'ssba_settings' )
|
369 |
+
);
|
370 |
+
|
371 |
+
// Query the db for current ssba settings.
|
372 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
373 |
+
|
374 |
+
// Get the current version.
|
375 |
+
$version = get_option( 'ssba_version' );
|
376 |
+
|
377 |
+
// There was a version set.
|
378 |
+
if ( false !== $version ) {
|
379 |
+
// Check if not updated to current version.
|
380 |
+
if ( $version < SSBA_VERSION ) {
|
381 |
+
// Run the upgrade function.
|
382 |
+
$this->database->upgrade_ssba( $arr_settings, $version );
|
383 |
+
}
|
384 |
+
}
|
385 |
+
}
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Answer form.
|
389 |
+
*
|
390 |
+
* @return bool
|
391 |
+
*/
|
392 |
+
public function ssba_settings() {
|
393 |
+
// Check if user has the rights to manage options.
|
394 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
395 |
+
// Permissions message.
|
396 |
+
wp_die(
|
397 |
+
esc_html__(
|
398 |
+
'You do not have sufficient permissions to access this page.',
|
399 |
+
'simple-share-buttons-adder'
|
400 |
+
)
|
401 |
+
);
|
402 |
+
}
|
403 |
+
|
404 |
+
$ssba_post = filter_input( INPUT_POST, 'ssbaData', FILTER_SANITIZE_STRING );
|
405 |
+
|
406 |
+
// If a post has been made.
|
407 |
+
if ( false === empty( $ssba_post ) ) {
|
408 |
+
// Get posted data.
|
409 |
+
$selected_tab = filter_input( INPUT_POST, 'ssba_selected_tab', FILTER_SANITIZE_STRING );
|
410 |
+
$selected_tab = sanitize_text_field( wp_unslash( $selected_tab ) );
|
411 |
+
|
412 |
+
$gdpr_config = filter_input( INPUT_POST, 'gdpr_config', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
|
413 |
+
|
414 |
+
parse_str( $ssba_post, $ssba_post );
|
415 |
+
|
416 |
+
// If the nonce doesn't check out.
|
417 |
+
if ( false === isset( $ssba_post['ssba_save_nonce'] ) || false === wp_verify_nonce(
|
418 |
+
$ssba_post['ssba_save_nonce'],
|
419 |
+
'ssba_save_settings'
|
420 |
+
) ) {
|
421 |
+
die(
|
422 |
+
esc_html__(
|
423 |
+
'There was no nonce provided, or the one provided did not verify.',
|
424 |
+
'simple-share-buttons-adder'
|
425 |
+
)
|
426 |
+
);
|
427 |
+
}
|
428 |
+
|
429 |
+
// Prepare array.
|
430 |
+
$arr_options = array(
|
431 |
+
'ssba_image_set' => $ssba_post['ssba_image_set'],
|
432 |
+
'ssba_size' => $ssba_post['ssba_size'],
|
433 |
+
'ssba_omit_pages' => ( isset( $ssba_post['ssba_omit_pages'] ) ? $ssba_post['ssba_omit_pages'] : '' ),
|
434 |
+
'ssba_omit_pages_plus' => ( isset( $ssba_post['ssba_omit_pages_plus'] ) ? $ssba_post['ssba_omit_pages_plus'] : '' ),
|
435 |
+
'ssba_omit_pages_bar' => ( isset( $ssba_post['ssba_omit_pages_bar'] ) ? $ssba_post['ssba_omit_pages_bar'] : '' ),
|
436 |
+
'ssba_pages' => ( isset( $ssba_post['ssba_pages'] ) ? $ssba_post['ssba_pages'] : 'N' ),
|
437 |
+
'ssba_posts' => ( isset( $ssba_post['ssba_posts'] ) ? $ssba_post['ssba_posts'] : 'N' ),
|
438 |
+
'ssba_cats_archs' => ( isset( $ssba_post['ssba_cats_archs'] ) ? $ssba_post['ssba_cats_archs'] : 'N' ),
|
439 |
+
'ssba_homepage' => ( isset( $ssba_post['ssba_homepage'] ) ? $ssba_post['ssba_homepage'] : 'N' ),
|
440 |
+
'ssba_excerpts' => ( isset( $ssba_post['ssba_excerpts'] ) ? $ssba_post['ssba_excerpts'] : 'N' ),
|
441 |
+
'ssba_plus_pages' => ( isset( $ssba_post['ssba_plus_pages'] ) ? $ssba_post['ssba_plus_pages'] : 'N' ),
|
442 |
+
'ssba_plus_posts' => ( isset( $ssba_post['ssba_plus_posts'] ) ? $ssba_post['ssba_plus_posts'] : 'N' ),
|
443 |
+
'ssba_plus_cats_archs' => ( isset( $ssba_post['ssba_plus_cats_archs'] ) ? $ssba_post['ssba_plus_cats_archs'] : 'N' ),
|
444 |
+
'ssba_plus_homepage' => ( isset( $ssba_post['ssba_plus_homepage'] ) ? $ssba_post['ssba_plus_homepage'] : 'N' ),
|
445 |
+
'ssba_plus_excerpts' => ( isset( $ssba_post['ssba_plus_excerpts'] ) ? $ssba_post['ssba_plus_excerpts'] : 'N' ),
|
446 |
+
'ssba_bar_pages' => ( isset( $ssba_post['ssba_bar_pages'] ) ? $ssba_post['ssba_bar_pages'] : 'N' ),
|
447 |
+
'ssba_bar_posts' => ( isset( $ssba_post['ssba_bar_posts'] ) ? $ssba_post['ssba_bar_posts'] : 'N' ),
|
448 |
+
'ssba_bar_cats_archs' => ( isset( $ssba_post['ssba_bar_cats_archs'] ) ? $ssba_post['ssba_bar_cats_archs'] : 'N' ),
|
449 |
+
'ssba_bar_homepage' => ( isset( $ssba_post['ssba_bar_homepage'] ) ? $ssba_post['ssba_bar_homepage'] : 'N' ),
|
450 |
+
'ssba_bar_excerpts' => ( isset( $ssba_post['ssba_bar_excerpts'] ) ? $ssba_post['ssba_bar_excerpts'] : 'N' ),
|
451 |
+
'ssba_align' => ( isset( $ssba_post['ssba_align'] ) ? $ssba_post['ssba_align'] : 'N' ),
|
452 |
+
'ssba_plus_align' => ( isset( $ssba_post['ssba_plus_align'] ) ? $ssba_post['ssba_plus_align'] : 'N' ),
|
453 |
+
'ssba_padding' => $ssba_post['ssba_padding'],
|
454 |
+
'ssba_before_or_after' => $ssba_post['ssba_before_or_after'],
|
455 |
+
'ssba_before_or_after_plus' => $ssba_post['ssba_before_or_after_plus'],
|
456 |
+
'ssba_additional_css' => $ssba_post['ssba_additional_css'],
|
457 |
+
'ssba_custom_styles' => $ssba_post['ssba_custom_styles'],
|
458 |
+
'ssba_custom_styles_enabled' => $ssba_post['ssba_custom_styles_enabled'],
|
459 |
+
'ssba_email_message' => stripslashes_deep( $ssba_post['ssba_email_message'] ),
|
460 |
+
'ssba_twitter_text' => stripslashes_deep( $ssba_post['ssba_twitter_text'] ),
|
461 |
+
'ssba_buffer_text' => stripslashes_deep( $ssba_post['ssba_buffer_text'] ),
|
462 |
+
'ssba_flattr_user_id' => stripslashes_deep( $ssba_post['ssba_flattr_user_id'] ),
|
463 |
+
'ssba_flattr_url' => stripslashes_deep( $ssba_post['ssba_flattr_url'] ),
|
464 |
+
'ssba_share_new_window' => ( isset( $ssba_post['ssba_share_new_window'] ) ? $ssba_post['ssba_share_new_window'] : 'N' ),
|
465 |
+
'ssba_link_to_ssb' => ( isset( $ssba_post['ssba_link_to_ssb'] ) ? $ssba_post['ssba_link_to_ssb'] : 'N' ),
|
466 |
+
'ssba_show_share_count' => ( isset( $ssba_post['ssba_show_share_count'] ) ? $ssba_post['ssba_show_share_count'] : 'N' ),
|
467 |
+
'ssba_share_count_style' => $ssba_post['ssba_share_count_style'],
|
468 |
+
'ssba_share_count_css' => $ssba_post['ssba_share_count_css'],
|
469 |
+
'ssba_share_count_once' => ( isset( $ssba_post['ssba_share_count_once'] ) ? $ssba_post['ssba_share_count_once'] : 'N' ),
|
470 |
+
'ssba_widget_text' => $ssba_post['ssba_widget_text'],
|
471 |
+
'ssba_rel_nofollow' => ( isset( $ssba_post['ssba_rel_nofollow'] ) ? $ssba_post['ssba_rel_nofollow'] : 'N' ),
|
472 |
+
'ssba_default_pinterest' => ( isset( $ssba_post['ssba_default_pinterest'] ) ? $ssba_post['ssba_default_pinterest'] : 'N' ),
|
473 |
+
'ssba_pinterest_featured' => ( isset( $ssba_post['ssba_pinterest_featured'] ) ? $ssba_post['ssba_pinterest_featured'] : 'N' ),
|
474 |
+
'ssba_content_priority' => ( isset( $ssba_post['ssba_content_priority'] ) ? $ssba_post['ssba_content_priority'] : 'N' ),
|
475 |
+
'ssba_plus_additional_css' => $ssba_post['ssba_plus_additional_css'],
|
476 |
+
'ssba_plus_email_message' => stripslashes_deep( $ssba_post['ssba_plus_email_message'] ),
|
477 |
+
'ssba_plus_twitter_text' => stripslashes_deep( $ssba_post['ssba_plus_twitter_text'] ),
|
478 |
+
'ssba_plus_buffer_text' => stripslashes_deep( $ssba_post['ssba_plus_buffer_text'] ),
|
479 |
+
'ssba_plus_flattr_user_id' => stripslashes_deep( $ssba_post['ssba_plus_flattr_user_id'] ),
|
480 |
+
'ssba_plus_flattr_url' => stripslashes_deep( $ssba_post['ssba_plus_flattr_url'] ),
|
481 |
+
'ssba_plus_share_new_window' => ( isset( $ssba_post['ssba_plus_share_new_window'] ) ? $ssba_post['ssba_plus_share_new_window'] : 'N' ),
|
482 |
+
'ssba_plus_link_to_ssb' => ( isset( $ssba_post['ssba_plus_link_to_ssb'] ) ? $ssba_post['ssba_plus_link_to_ssb'] : 'N' ),
|
483 |
+
'ssba_plus_show_share_count' => ( isset( $ssba_post['ssba_plus_show_share_count'] ) ? $ssba_post['ssba_plus_show_share_count'] : 'N' ),
|
484 |
+
'ssba_plus_share_count_style' => $ssba_post['ssba_plus_share_count_style'],
|
485 |
+
'ssba_plus_share_count_css' => $ssba_post['ssba_plus_share_count_css'],
|
486 |
+
'ssba_plus_share_count_once' => ( isset( $ssba_post['ssba_plus_share_count_once'] ) ? $ssba_post['ssba_plus_share_count_once'] : 'N' ),
|
487 |
+
'ssba_plus_widget_text' => $ssba_post['ssba_plus_widget_text'],
|
488 |
+
'ssba_plus_rel_nofollow' => ( isset( $ssba_post['ssba_plus_rel_nofollow'] ) ? $ssba_post['ssba_plus_rel_nofollow'] : 'N' ),
|
489 |
+
'ssba_plus_default_pinterest' => ( isset( $ssba_post['ssba_plus_default_pinterest'] ) ? $ssba_post['ssba_plus_default_pinterest'] : 'N' ),
|
490 |
+
'ssba_plus_pinterest_featured' => ( isset( $ssba_post['ssba_plus_pinterest_featured'] ) ? $ssba_post['ssba_plus_pinterest_featured'] : 'N' ),
|
491 |
+
'ssba_bar_additional_css' => $ssba_post['ssba_bar_additional_css'],
|
492 |
+
'ssba_bar_email_message' => stripslashes_deep( $ssba_post['ssba_bar_email_message'] ),
|
493 |
+
'ssba_bar_twitter_text' => stripslashes_deep( $ssba_post['ssba_bar_twitter_text'] ),
|
494 |
+
'ssba_bar_buffer_text' => stripslashes_deep( $ssba_post['ssba_bar_buffer_text'] ),
|
495 |
+
'ssba_bar_flattr_user_id' => stripslashes_deep( $ssba_post['ssba_bar_flattr_user_id'] ),
|
496 |
+
'ssba_bar_flattr_url' => stripslashes_deep( $ssba_post['ssba_bar_flattr_url'] ),
|
497 |
+
'ssba_bar_share_new_window' => ( isset( $ssba_post['ssba_bar_share_new_window'] ) ? $ssba_post['ssba_bar_share_new_window'] : 'N' ),
|
498 |
+
'ssba_bar_link_to_ssb' => ( isset( $ssba_post['ssba_bar_link_to_ssb'] ) ? $ssba_post['ssba_bar_link_to_ssb'] : 'N' ),
|
499 |
+
'ssba_bar_show_share_count' => ( isset( $ssba_post['ssba_bar_show_share_count'] ) ? $ssba_post['ssba_bar_show_share_count'] : 'N' ),
|
500 |
+
'ssba_bar_share_count_style' => $ssba_post['ssba_bar_share_count_style'],
|
501 |
+
'ssba_bar_share_count_css' => $ssba_post['ssba_bar_share_count_css'],
|
502 |
+
'ssba_bar_share_count_once' => ( isset( $ssba_post['ssba_bar_share_count_once'] ) ? $ssba_post['ssba_bar_share_count_once'] : 'N' ),
|
503 |
+
'ssba_bar_widget_text' => $ssba_post['ssba_bar_widget_text'],
|
504 |
+
'ssba_bar_rel_nofollow' => ( isset( $ssba_post['ssba_bar_rel_nofollow'] ) ? $ssba_post['ssba_bar_rel_nofollow'] : 'N' ),
|
505 |
+
'ssba_bar_default_pinterest' => ( isset( $ssba_post['ssba_bar_default_pinterest'] ) ? $ssba_post['ssba_bar_default_pinterest'] : 'N' ),
|
506 |
+
'ssba_bar_pinterest_featured' => ( isset( $ssba_post['ssba_bar_pinterest_featured'] ) ? $ssba_post['ssba_bar_pinterest_featured'] : 'N' ),
|
507 |
+
|
508 |
+
// Share container.
|
509 |
+
'ssba_div_padding' => $ssba_post['ssba_div_padding'],
|
510 |
+
'ssba_div_rounded_corners' => ( isset( $ssba_post['ssba_div_rounded_corners'] ) ? $ssba_post['ssba_div_rounded_corners'] : 'N' ),
|
511 |
+
'ssba_border_width' => $ssba_post['ssba_border_width'],
|
512 |
+
'ssba_div_border' => $ssba_post['ssba_div_border'],
|
513 |
+
'ssba_div_background' => $ssba_post['ssba_div_background'],
|
514 |
+
|
515 |
+
// Text.
|
516 |
+
'ssba_share_text' => stripslashes_deep( $ssba_post['ssba_share_text'] ),
|
517 |
+
'ssba_text_placement' => $ssba_post['ssba_text_placement'],
|
518 |
+
'ssba_font_family' => $ssba_post['ssba_font_family'],
|
519 |
+
'ssba_font_color' => $ssba_post['ssba_font_color'],
|
520 |
+
'ssba_font_size' => $ssba_post['ssba_font_size'],
|
521 |
+
'ssba_font_weight' => $ssba_post['ssba_font_weight'],
|
522 |
+
'ssba_plus_share_text' => stripslashes_deep( $ssba_post['ssba_plus_share_text'] ),
|
523 |
+
'ssba_plus_text_placement' => $ssba_post['ssba_plus_text_placement'],
|
524 |
+
'ssba_plus_font_family' => $ssba_post['ssba_plus_font_family'],
|
525 |
+
'ssba_plus_font_color' => $ssba_post['ssba_plus_font_color'],
|
526 |
+
'ssba_plus_font_size' => $ssba_post['ssba_plus_font_size'],
|
527 |
+
'ssba_plus_font_weight' => $ssba_post['ssba_plus_font_weight'],
|
528 |
+
|
529 |
+
// Included buttons.
|
530 |
+
'ssba_selected_buttons' => $ssba_post['ssba_selected_buttons'],
|
531 |
+
'ssba_selected_bar_buttons' => $ssba_post['ssba_selected_bar_buttons'],
|
532 |
+
'ssba_selected_plus_buttons' => $ssba_post['ssba_selected_plus_buttons'],
|
533 |
+
'ssba_plus_button_style' => $ssba_post['ssba_plus_button_style'],
|
534 |
+
'ssba_bar_style' => $ssba_post['ssba_bar_style'],
|
535 |
+
'ssba_new_buttons' => $ssba_post['ssba_new_buttons'],
|
536 |
+
'ssba_bar_enabled' => $ssba_post['ssba_bar_enabled'],
|
537 |
+
'ssba_bar_position' => $ssba_post['ssba_bar_position'],
|
538 |
+
'ssba_plus_height' => $ssba_post['ssba_plus_height'],
|
539 |
+
'ssba_plus_width' => $ssba_post['ssba_plus_width'],
|
540 |
+
'ssba_plus_margin' => $ssba_post['ssba_plus_margin'],
|
541 |
+
'ssba_plus_button_color' => $ssba_post['ssba_plus_button_color'],
|
542 |
+
'ssba_plus_button_hover_color' => $ssba_post['ssba_plus_button_hover_color'],
|
543 |
+
'ssba_plus_icon_size' => $ssba_post['ssba_plus_icon_size'],
|
544 |
+
'ssba_plus_icon_color' => $ssba_post['ssba_plus_icon_color'],
|
545 |
+
'ssba_plus_icon_hover_color' => $ssba_post['ssba_plus_icon_hover_color'],
|
546 |
+
'ssba_bar_height' => $ssba_post['ssba_bar_height'],
|
547 |
+
'ssba_bar_width' => $ssba_post['ssba_bar_width'],
|
548 |
+
'ssba_bar_button_color' => $ssba_post['ssba_bar_button_color'],
|
549 |
+
'ssba_bar_button_hover_color' => $ssba_post['ssba_bar_button_hover_color'],
|
550 |
+
'ssba_bar_icon_size' => $ssba_post['ssba_bar_icon_size'],
|
551 |
+
'ssba_bar_icon_color' => $ssba_post['ssba_bar_icon_color'],
|
552 |
+
'ssba_bar_icon_hover_color' => $ssba_post['ssba_bar_icon_hover_color'],
|
553 |
+
'ssba_bar_desktop' => isset( $ssba_post['ssba_bar_desktop'] ) ? $ssba_post['ssba_bar_desktop'] : 'N',
|
554 |
+
'ssba_bar_margin' => $ssba_post['ssba_bar_margin'],
|
555 |
+
'ssba_bar_mobile' => isset( $ssba_post['ssba_bar_mobile'] ) ? $ssba_post['ssba_bar_mobile'] : 'N',
|
556 |
+
'ssba_mobile_breakpoint' => $ssba_post['ssba_mobile_breakpoint'],
|
557 |
+
'ssba_custom_facebook' => $ssba_post['ssba_custom_facebook'],
|
558 |
+
'ssba_custom_twitter' => $ssba_post['ssba_custom_twitter'],
|
559 |
+
'ssba_custom_linkedin' => $ssba_post['ssba_custom_linkedin'],
|
560 |
+
'ssba_custom_flattr' => $ssba_post['ssba_custom_flattr'],
|
561 |
+
'ssba_custom_pinterest' => $ssba_post['ssba_custom_pinterest'],
|
562 |
+
'ssba_custom_print' => $ssba_post['ssba_custom_print'],
|
563 |
+
'ssba_custom_reddit' => $ssba_post['ssba_custom_reddit'],
|
564 |
+
'ssba_custom_stumbleupon' => $ssba_post['ssba_custom_stumbleupon'],
|
565 |
+
'ssba_custom_tumblr' => $ssba_post['ssba_custom_tumblr'],
|
566 |
+
'ssba_custom_vk' => $ssba_post['ssba_custom_vk'],
|
567 |
+
'ssba_custom_whatsapp' => $ssba_post['ssba_custom_whatsapp'],
|
568 |
+
'ssba_custom_xing' => $ssba_post['ssba_custom_xing'],
|
569 |
+
'ssba_custom_yummly' => $ssba_post['ssba_custom_yummly'],
|
570 |
+
'ssba_custom_email' => $ssba_post['ssba_custom_email'],
|
571 |
+
'ssba_custom_buffer' => $ssba_post['ssba_custom_buffer'],
|
572 |
+
'ssba_custom_diggit' => $ssba_post['ssba_custom_diggit'],
|
573 |
+
'ssba_custom_facebook_save' => $ssba_post['ssba_custom_facebook_save'],
|
574 |
+
|
575 |
+
// Shared count.
|
576 |
+
'sharedcount_enabled' => isset( $ssba_post['sharedcount_enabled'] ) ? $ssba_post['sharedcount_enabled'] : 'N',
|
577 |
+
'sharedcount_api_key' => $ssba_post['sharedcount_api_key'],
|
578 |
+
'sharedcount_plan' => $ssba_post['sharedcount_plan'],
|
579 |
+
|
580 |
+
// Facebook.
|
581 |
+
'facebook_insights' => $ssba_post['facebook_insights'],
|
582 |
+
'facebook_app_id' => $ssba_post['facebook_app_id'],
|
583 |
+
'ignore_facebook_sdk' => $ssba_post['ignore_facebook_sdk'],
|
584 |
+
'plus_facebook_insights' => $ssba_post['plus_facebook_insights'],
|
585 |
+
'plus_facebook_app_id' => $ssba_post['plus_facebook_app_id'],
|
586 |
+
'plus_ignore_facebook_sdk' => $ssba_post['plus_ignore_facebook_sdk'],
|
587 |
+
'bar_facebook_insights' => $ssba_post['bar_facebook_insights'],
|
588 |
+
'bar_facebook_app_id' => $ssba_post['bar_facebook_app_id'],
|
589 |
+
'ssba_gdpr_config' => $gdpr_config,
|
590 |
+
);
|
591 |
+
|
592 |
+
// Save the settings.
|
593 |
+
$this->class_ssba->ssba_update_options( $arr_options );
|
594 |
+
|
595 |
+
// Save selected tab.
|
596 |
+
update_option( 'ssba_selected_tab', $selected_tab );
|
597 |
+
|
598 |
+
// Return success.
|
599 |
+
return true;
|
600 |
+
}
|
601 |
+
|
602 |
+
// Query the db for current ssba settings.
|
603 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
604 |
+
|
605 |
+
// Admin panel.
|
606 |
+
$this->admin_panel->admin_panel( $arr_settings );
|
607 |
+
}
|
608 |
}
|
php/class-admin-panel.php
CHANGED
@@ -12,1780 +12,1817 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Admin_Panel
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
$
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1789 |
font-family: 'ssbp';
|
1790 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?xj3ol1');
|
1791 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?#iefixxj3ol1') format('embedded-opentype'),
|
@@ -1799,15 +1836,14 @@ class Admin_Panel
|
|
1799 |
-webkit-font-smoothing: antialiased;
|
1800 |
-moz-osx-font-smoothing: grayscale;
|
1801 |
}";
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
}
|
1813 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Admin_Panel {
|
16 |
+
/**
|
17 |
+
* Plugin instance.
|
18 |
+
*
|
19 |
+
* @var object
|
20 |
+
*/
|
21 |
+
public $plugin;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Simple Share Buttons Adder instance.
|
25 |
+
*
|
26 |
+
* @var object
|
27 |
+
*/
|
28 |
+
public $class_ssba;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Widget Class instance.
|
32 |
+
*
|
33 |
+
* @var object
|
34 |
+
*/
|
35 |
+
public $widget_class;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Forms instance.
|
39 |
+
*
|
40 |
+
* @var object
|
41 |
+
*/
|
42 |
+
public $forms;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Admin_Panel constructor.
|
46 |
+
*
|
47 |
+
* @param object $plugin Plugin instance.
|
48 |
+
* @param object $class_ssba Simple Share Buttons Adder instance.
|
49 |
+
* @param object $forms Forms instance.
|
50 |
+
* @param string $widget_class Widget class.
|
51 |
+
*/
|
52 |
+
public function __construct( $plugin, $class_ssba, $forms, $widget_class ) {
|
53 |
+
$this->plugin = $plugin;
|
54 |
+
$this->class_ssba = $class_ssba;
|
55 |
+
$this->forms = $forms;
|
56 |
+
$this->widget_class = $widget_class;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Display the admin header.
|
61 |
+
*/
|
62 |
+
public function admin_header() {
|
63 |
+
include_once "{$this->plugin->dir_path}/templates/admin-header.php";
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Display the admin footer.
|
68 |
+
*/
|
69 |
+
public function admin_footer() {
|
70 |
+
include_once "{$this->plugin->dir_path}/templates/admin-footer.php";
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Enqueue the custom gutenberg block script.
|
75 |
+
*
|
76 |
+
* @action enqueue_block_editor_assets
|
77 |
+
*/
|
78 |
+
public function enqueue_custom_blocks() {
|
79 |
+
wp_enqueue_script(
|
80 |
+
"{$this->plugin->assets_prefix}-blocks",
|
81 |
+
"{$this->plugin->dir_url}js/blocks.js",
|
82 |
+
array( 'wp-blocks', 'wp-editor', 'wp-element', 'wp-components' ),
|
83 |
+
time(),
|
84 |
+
true
|
85 |
+
);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Register new block category for share buttons.
|
90 |
+
*
|
91 |
+
* @param array[] $categories Array of categories for block types.
|
92 |
+
* @param \WP_Post $post Post being loaded.
|
93 |
+
*
|
94 |
+
* @filter block_categories, 999
|
95 |
+
*/
|
96 |
+
public function simpleshare_block_category( $categories, $post ) {
|
97 |
+
return array_merge(
|
98 |
+
$categories,
|
99 |
+
array(
|
100 |
+
array(
|
101 |
+
'slug' => 'simpleshare-blocks',
|
102 |
+
'title' => __( 'SimpleShare Blocks', 'simple-share-buttons-adder' ),
|
103 |
+
),
|
104 |
+
)
|
105 |
+
);
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Build the Admin Panel html variables and include template.
|
111 |
+
*
|
112 |
+
* @param array $arr_settings The current ssba settings.
|
113 |
+
*/
|
114 |
+
public function admin_panel( $arr_settings ) {
|
115 |
+
// Locations array.
|
116 |
+
$locs = array(
|
117 |
+
'Homepage' => array(
|
118 |
+
'value' => 'ssba_homepage',
|
119 |
+
'checked' => isset( $arr_settings['ssba_homepage'] ) && 'Y' === $arr_settings['ssba_homepage'] ? true : false,
|
120 |
+
),
|
121 |
+
'Pages' => array(
|
122 |
+
'value' => 'ssba_pages',
|
123 |
+
'checked' => isset( $arr_settings['ssba_pages'] ) && 'Y' === $arr_settings['ssba_pages'] ? true : false,
|
124 |
+
),
|
125 |
+
'Posts' => array(
|
126 |
+
'value' => 'ssba_posts',
|
127 |
+
'checked' => isset( $arr_settings['ssba_posts'] ) && 'Y' === $arr_settings['ssba_posts'] ? true : false,
|
128 |
+
),
|
129 |
+
'Excerpts' => array(
|
130 |
+
'value' => 'ssba_excerpts',
|
131 |
+
'checked' => isset( $arr_settings['ssba_excerpts'] ) && 'Y' === $arr_settings['ssba_excerpts'] ? true : false,
|
132 |
+
),
|
133 |
+
'Categories/Archives' => array(
|
134 |
+
'value' => 'ssba_cats_archs',
|
135 |
+
'checked' => isset( $arr_settings['ssba_cats_archs'] ) && 'Y' === $arr_settings['ssba_cats_archs'] ? true : false,
|
136 |
+
),
|
137 |
+
);
|
138 |
+
|
139 |
+
// Locations array.
|
140 |
+
$locs2 = array(
|
141 |
+
'Homepage' => array(
|
142 |
+
'value' => 'ssba_bar_homepage',
|
143 |
+
'checked' => isset( $arr_settings['ssba_bar_homepage'] ) && 'Y' === $arr_settings['ssba_bar_homepage'] ? true : false,
|
144 |
+
),
|
145 |
+
'Pages' => array(
|
146 |
+
'value' => 'ssba_bar_pages',
|
147 |
+
'checked' => isset( $arr_settings['ssba_bar_pages'] ) && 'Y' === $arr_settings['ssba_bar_pages'] ? true : false,
|
148 |
+
),
|
149 |
+
'Posts' => array(
|
150 |
+
'value' => 'ssba_bar_posts',
|
151 |
+
'checked' => isset( $arr_settings['ssba_bar_posts'] ) && 'Y' === $arr_settings['ssba_bar_posts'] ? true : false,
|
152 |
+
),
|
153 |
+
'Categories/Archives' => array(
|
154 |
+
'value' => 'ssba_bar_cats_archs',
|
155 |
+
'checked' => isset( $arr_settings['ssba_bar_cats_archs'] ) && 'Y' === $arr_settings['ssba_bar_cats_archs'] ? true : false,
|
156 |
+
),
|
157 |
+
);
|
158 |
+
|
159 |
+
// Locations array for plus.
|
160 |
+
$locs3 = array(
|
161 |
+
'Homepage' => array(
|
162 |
+
'value' => 'ssba_plus_homepage',
|
163 |
+
'checked' => isset( $arr_settings['ssba_plus_homepage'] ) && 'Y' === $arr_settings['ssba_plus_homepage'] ? true : false,
|
164 |
+
),
|
165 |
+
'Pages' => array(
|
166 |
+
'value' => 'ssba_plus_pages',
|
167 |
+
'checked' => isset( $arr_settings['ssba_plus_pages'] ) && 'Y' === $arr_settings['ssba_plus_pages'] ? true : false,
|
168 |
+
),
|
169 |
+
'Posts' => array(
|
170 |
+
'value' => 'ssba_plus_posts',
|
171 |
+
'checked' => isset( $arr_settings['ssba_plus_posts'] ) && 'Y' === $arr_settings['ssba_plus_posts'] ? true : false,
|
172 |
+
),
|
173 |
+
'Excerpts' => array(
|
174 |
+
'value' => 'ssba_plus_excerpts',
|
175 |
+
'checked' => isset( $arr_settings['ssba_plus_excerpts'] ) && 'Y' === $arr_settings['ssba_plus_excerpts'] ? true : false,
|
176 |
+
),
|
177 |
+
'Categories/Archives' => array(
|
178 |
+
'value' => 'ssba_plus_cats_archs',
|
179 |
+
'checked' => isset( $arr_settings['ssba_plus_cats_archs'] ) && 'Y' === $arr_settings['ssba_plus_cats_archs'] ? true : false,
|
180 |
+
),
|
181 |
+
);
|
182 |
+
|
183 |
+
// Display options.
|
184 |
+
$display_loc = array(
|
185 |
+
'Desktop' => array(
|
186 |
+
'value' => 'ssba_bar_desktop',
|
187 |
+
'checked' => isset( $arr_settings['ssba_bar_desktop'] ) && 'Y' === $arr_settings['ssba_bar_desktop'] ? true : false,
|
188 |
+
),
|
189 |
+
'Mobile' => array(
|
190 |
+
'value' => 'ssba_bar_mobile',
|
191 |
+
'checked' => isset( $arr_settings['ssba_bar_mobile'] ) && 'Y' === $arr_settings['ssba_bar_mobile'] ? true : false,
|
192 |
+
),
|
193 |
+
);
|
194 |
+
|
195 |
+
// Prepare array of buttons.
|
196 |
+
$arr_buttons = get_option( 'ssba_buttons', true );
|
197 |
+
|
198 |
+
// Locations.
|
199 |
+
$opts1 = array(
|
200 |
+
'form_group' => false,
|
201 |
+
'label' => 'Locations',
|
202 |
+
'tooltip' => 'Enable the locations you wish for share buttons to appear',
|
203 |
+
'value' => 'Y',
|
204 |
+
'checkboxes' => $locs,
|
205 |
+
);
|
206 |
+
|
207 |
+
// Placement.
|
208 |
+
$opts2 = array(
|
209 |
+
'form_group' => false,
|
210 |
+
'type' => 'select',
|
211 |
+
'name' => 'ssba_before_or_after',
|
212 |
+
'label' => 'Placement',
|
213 |
+
'tooltip' => 'Place share buttons before or after your content',
|
214 |
+
'selected' => isset( $arr_settings['ssba_before_or_after'] ) ? $arr_settings['ssba_before_or_after'] : '',
|
215 |
+
'options' => array(
|
216 |
+
'After' => 'after',
|
217 |
+
'Before' => 'before',
|
218 |
+
'Both' => 'both',
|
219 |
+
),
|
220 |
+
);
|
221 |
+
|
222 |
+
// Share text.
|
223 |
+
$opts3 = array(
|
224 |
+
'form_group' => false,
|
225 |
+
'type' => 'text',
|
226 |
+
'placeholder' => 'Share this...',
|
227 |
+
'name' => 'ssba_share_text',
|
228 |
+
'label' => 'Call To Action',
|
229 |
+
'tooltip' => 'Add some custom text by your share buttons',
|
230 |
+
'value' => isset( $arr_settings['ssba_share_text'] ) ? $arr_settings['ssba_share_text'] : '',
|
231 |
+
);
|
232 |
+
|
233 |
+
// Share text for plus.
|
234 |
+
$opts3p = array(
|
235 |
+
'form_group' => false,
|
236 |
+
'type' => 'text',
|
237 |
+
'placeholder' => 'Share this...',
|
238 |
+
'name' => 'ssba_plus_share_text',
|
239 |
+
'label' => 'Call To Action',
|
240 |
+
'tooltip' => 'Add some custom text by your share buttons',
|
241 |
+
'value' => isset( $arr_settings['ssba_plus_share_text'] ) ? $arr_settings['ssba_plus_share_text'] : '',
|
242 |
+
);
|
243 |
+
|
244 |
+
// Placement.
|
245 |
+
$opts4 = array(
|
246 |
+
'form_group' => false,
|
247 |
+
'type' => 'select',
|
248 |
+
'name' => 'ssba_image_set',
|
249 |
+
'label' => 'Theme',
|
250 |
+
'tooltip' => 'Choose your favourite set of buttons, or set to custom to choose your own',
|
251 |
+
'selected' => isset( $arr_settings['ssba_image_set'] ) ? $arr_settings['ssba_image_set'] : '',
|
252 |
+
'options' => array(
|
253 |
+
'Arbenta' => 'arbenta',
|
254 |
+
'Custom' => 'custom',
|
255 |
+
'Metal' => 'metal',
|
256 |
+
'Pagepeel' => 'pagepeel',
|
257 |
+
'Plain' => 'plain',
|
258 |
+
'Retro' => 'retro',
|
259 |
+
'Ribbons' => 'ribbons',
|
260 |
+
'Simple' => 'simple',
|
261 |
+
'Somacro' => 'somacro',
|
262 |
+
),
|
263 |
+
);
|
264 |
+
|
265 |
+
// Button size.
|
266 |
+
$opts6 = array(
|
267 |
+
'form_group' => false,
|
268 |
+
'type' => 'number_addon',
|
269 |
+
'addon' => 'px',
|
270 |
+
'placeholder' => '35',
|
271 |
+
'name' => 'ssba_size',
|
272 |
+
'label' => 'Button Size',
|
273 |
+
'tooltip' => 'Set the size of your buttons in pixels',
|
274 |
+
'value' => isset( $arr_settings['ssba_size'] ) ? $arr_settings['ssba_size'] : '',
|
275 |
+
);
|
276 |
+
|
277 |
+
// Alignment.
|
278 |
+
$opts7 = array(
|
279 |
+
'form_group' => false,
|
280 |
+
'type' => 'select',
|
281 |
+
'name' => 'ssba_align',
|
282 |
+
'label' => 'Alignment',
|
283 |
+
'tooltip' => 'Align your buttons the way you wish',
|
284 |
+
'selected' => isset( $arr_settings['ssba_align'] ) ? $arr_settings['ssba_align'] : '',
|
285 |
+
'options' => array(
|
286 |
+
'Left' => 'left',
|
287 |
+
'Center' => 'center',
|
288 |
+
'Right' => 'right',
|
289 |
+
),
|
290 |
+
);
|
291 |
+
|
292 |
+
// Alignment for Plus.
|
293 |
+
$opts7p = array(
|
294 |
+
'form_group' => false,
|
295 |
+
'type' => 'select',
|
296 |
+
'name' => 'ssba_plus_align',
|
297 |
+
'label' => 'Alignment',
|
298 |
+
'tooltip' => 'Align your plus buttons the way you wish',
|
299 |
+
'selected' => isset( $arr_settings['ssba_plus_align'] ) ? $arr_settings['ssba_plus_align'] : 'center',
|
300 |
+
'options' => array(
|
301 |
+
'Left' => 'left',
|
302 |
+
'Center' => 'center',
|
303 |
+
'Right' => 'right',
|
304 |
+
),
|
305 |
+
);
|
306 |
+
|
307 |
+
// Padding.
|
308 |
+
$opts8 = array(
|
309 |
+
'form_group' => false,
|
310 |
+
'type' => 'number_addon',
|
311 |
+
'addon' => 'px',
|
312 |
+
'placeholder' => '10',
|
313 |
+
'max' => '50',
|
314 |
+
'name' => 'ssba_padding',
|
315 |
+
'label' => 'Padding',
|
316 |
+
'tooltip' => 'Apply some space around your images',
|
317 |
+
'value' => isset( $arr_settings['ssba_padding'] ) ? $arr_settings['ssba_padding'] : '',
|
318 |
+
);
|
319 |
+
|
320 |
+
// Font color.
|
321 |
+
$opts9 = array(
|
322 |
+
'form_group' => false,
|
323 |
+
'type' => 'colorpicker',
|
324 |
+
'name' => 'ssba_font_color',
|
325 |
+
'label' => 'Font Color',
|
326 |
+
'tooltip' => 'Choose the color of your share text',
|
327 |
+
'value' => isset( $arr_settings['ssba_font_color'] ) ? $arr_settings['ssba_font_color'] : '',
|
328 |
+
);
|
329 |
+
|
330 |
+
// Font color for plus.
|
331 |
+
$opts9p = array(
|
332 |
+
'form_group' => false,
|
333 |
+
'type' => 'colorpicker',
|
334 |
+
'name' => 'ssba_plus_font_color',
|
335 |
+
'label' => 'Font Color',
|
336 |
+
'tooltip' => 'Choose the color of your share text',
|
337 |
+
'value' => isset( $arr_settings['ssba_plus_font_color'] ) ? $arr_settings['ssba_plus_font_color'] : '',
|
338 |
+
);
|
339 |
+
|
340 |
+
// Font family.
|
341 |
+
$opts10 = array(
|
342 |
+
'form_group' => false,
|
343 |
+
'type' => 'select',
|
344 |
+
'name' => 'ssba_font_family',
|
345 |
+
'label' => 'Font Family',
|
346 |
+
'tooltip' => 'Choose a font available or inherit the font from your website',
|
347 |
+
'selected' => isset( $arr_settings['ssba_font_family'] ) ? $arr_settings['ssba_font_family'] : '',
|
348 |
+
'options' => array(
|
349 |
+
'Reenie Beanie' => 'Reenie Beanie',
|
350 |
+
'Indie Flower' => 'Indie Flower',
|
351 |
+
'Inherit from my website' => '',
|
352 |
+
),
|
353 |
+
);
|
354 |
+
|
355 |
+
// Font family for plus.
|
356 |
+
$opts10p = array(
|
357 |
+
'form_group' => false,
|
358 |
+
'type' => 'select',
|
359 |
+
'name' => 'ssba_plus_font_family',
|
360 |
+
'label' => 'Font Family',
|
361 |
+
'tooltip' => 'Choose a font available or inherit the font from your website',
|
362 |
+
'selected' => isset( $arr_settings['ssba_plus_font_family'] ) ? $arr_settings['ssba_plus_font_family'] : '',
|
363 |
+
'options' => array(
|
364 |
+
'Reenie Beanie' => 'Reenie Beanie',
|
365 |
+
'Indie Flower' => 'Indie Flower',
|
366 |
+
'Inherit from my website' => '',
|
367 |
+
),
|
368 |
+
);
|
369 |
+
|
370 |
+
// Enqueue the styles so preview can update.
|
371 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-reenie" );
|
372 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-indie" );
|
373 |
+
|
374 |
+
// Font size.
|
375 |
+
$opts11 = array(
|
376 |
+
'form_group' => false,
|
377 |
+
'type' => 'number_addon',
|
378 |
+
'addon' => 'px',
|
379 |
+
'placeholder' => '20',
|
380 |
+
'name' => 'ssba_font_size',
|
381 |
+
'label' => 'Font Size',
|
382 |
+
'tooltip' => 'Set the size of the share text in pixels',
|
383 |
+
'value' => isset( $arr_settings['ssba_font_size'] ) ? $arr_settings['ssba_font_size'] : '',
|
384 |
+
);
|
385 |
+
|
386 |
+
// Font size for plus.
|
387 |
+
$opts11p = array(
|
388 |
+
'form_group' => false,
|
389 |
+
'type' => 'number_addon',
|
390 |
+
'addon' => 'px',
|
391 |
+
'placeholder' => '20',
|
392 |
+
'name' => 'ssba_plus_font_size',
|
393 |
+
'label' => 'Font Size',
|
394 |
+
'tooltip' => 'Set the size of the share text in pixels',
|
395 |
+
'value' => isset( $arr_settings['ssba_plus_font_size'] ) ? $arr_settings['ssba_plus_font_size'] : '',
|
396 |
+
);
|
397 |
+
|
398 |
+
// Font weight.
|
399 |
+
$opts12 = array(
|
400 |
+
'form_group' => false,
|
401 |
+
'type' => 'select',
|
402 |
+
'name' => 'ssba_font_weight',
|
403 |
+
'label' => 'Font Weight',
|
404 |
+
'tooltip' => 'Set the weight of the share text',
|
405 |
+
'selected' => isset( $arr_settings['ssba_font_weight'] ) ? $arr_settings['ssba_font_weight'] : '',
|
406 |
+
'options' => array(
|
407 |
+
'Normal' => 'normal',
|
408 |
+
'Bold' => 'bold',
|
409 |
+
'Light' => 'light',
|
410 |
+
),
|
411 |
+
);
|
412 |
+
|
413 |
+
// Font weight for plus.
|
414 |
+
$opts12p = array(
|
415 |
+
'form_group' => false,
|
416 |
+
'type' => 'select',
|
417 |
+
'name' => 'ssba_plus_font_weight',
|
418 |
+
'label' => 'Font Weight',
|
419 |
+
'tooltip' => 'Set the weight of the share text',
|
420 |
+
'selected' => isset( $arr_settings['ssba_plus_font_weight'] ) ? $arr_settings['ssba_plus_font_weight'] : '',
|
421 |
+
'options' => array(
|
422 |
+
'Normal' => 'normal',
|
423 |
+
'Bold' => 'bold',
|
424 |
+
'Light' => 'light',
|
425 |
+
),
|
426 |
+
);
|
427 |
+
|
428 |
+
// Text placement.
|
429 |
+
$opts13 = array(
|
430 |
+
'form_group' => false,
|
431 |
+
'type' => 'select',
|
432 |
+
'name' => 'ssba_text_placement',
|
433 |
+
'label' => 'Text placement',
|
434 |
+
'tooltip' => 'Choose where you want your text to be displayed, in relation to the buttons',
|
435 |
+
'selected' => isset( $arr_settings['ssba_text_placement'] ) ? $arr_settings['ssba_text_placement'] : '',
|
436 |
+
'options' => array(
|
437 |
+
'Above' => 'above',
|
438 |
+
'Left' => 'left',
|
439 |
+
'Right' => 'right',
|
440 |
+
'Below' => 'below',
|
441 |
+
),
|
442 |
+
);
|
443 |
+
|
444 |
+
// Text placement for plus.
|
445 |
+
$opts13p = array(
|
446 |
+
'form_group' => false,
|
447 |
+
'type' => 'select',
|
448 |
+
'name' => 'ssba_plus_text_placement',
|
449 |
+
'label' => 'Text placement',
|
450 |
+
'tooltip' => 'Choose where you want your text to be displayed, in relation to the buttons',
|
451 |
+
'selected' => isset( $arr_settings['ssba_plus_text_placement'] ) ? $arr_settings['ssba_plus_text_placement'] : '',
|
452 |
+
'options' => array(
|
453 |
+
'Above' => 'above',
|
454 |
+
'Left' => 'left',
|
455 |
+
'Right' => 'right',
|
456 |
+
'Below' => 'below',
|
457 |
+
),
|
458 |
+
);
|
459 |
+
|
460 |
+
// Container padding.
|
461 |
+
$opts14 = array(
|
462 |
+
'form_group' => false,
|
463 |
+
'type' => 'number_addon',
|
464 |
+
'addon' => 'px',
|
465 |
+
'placeholder' => '10',
|
466 |
+
'name' => 'ssba_div_padding',
|
467 |
+
'label' => 'Container Padding',
|
468 |
+
'tooltip' => 'Add some padding to your share container',
|
469 |
+
'value' => isset( $arr_settings['ssba_div_padding'] ) ? $arr_settings['ssba_div_padding'] : '',
|
470 |
+
);
|
471 |
+
|
472 |
+
// Div background color.
|
473 |
+
$opts15 = array(
|
474 |
+
'form_group' => false,
|
475 |
+
'type' => 'colorpicker',
|
476 |
+
'name' => 'ssba_div_background',
|
477 |
+
'label' => 'Container Background Color',
|
478 |
+
'tooltip' => 'Choose the color of your share container',
|
479 |
+
'value' => isset( $arr_settings['ssba_div_background'] ) ? $arr_settings['ssba_div_background'] : '',
|
480 |
+
);
|
481 |
+
|
482 |
+
// Div border color.
|
483 |
+
$opts16 = array(
|
484 |
+
'form_group' => false,
|
485 |
+
'type' => 'colorpicker',
|
486 |
+
'name' => 'ssba_div_border',
|
487 |
+
'label' => 'Container Border Color',
|
488 |
+
'tooltip' => 'Choose the color of your share container border',
|
489 |
+
'value' => isset( $arr_settings['ssba_div_border'] ) ? $arr_settings['ssba_div_border'] : '',
|
490 |
+
);
|
491 |
+
|
492 |
+
// Container border width.
|
493 |
+
$opts17 = array(
|
494 |
+
'form_group' => false,
|
495 |
+
'type' => 'number_addon',
|
496 |
+
'addon' => 'px',
|
497 |
+
'placeholder' => '1',
|
498 |
+
'name' => 'ssba_border_width',
|
499 |
+
'label' => 'Container Border Width',
|
500 |
+
'tooltip' => 'Set the width of the share container border',
|
501 |
+
'value' => isset( $arr_settings['ssba_border_width'] ) ? $arr_settings['ssba_border_width'] : '',
|
502 |
+
);
|
503 |
+
|
504 |
+
// Rounded container corners.
|
505 |
+
$opts18 = array(
|
506 |
+
'form_group' => false,
|
507 |
+
'type' => 'checkbox',
|
508 |
+
'name' => 'ssba_div_rounded_corners',
|
509 |
+
'label' => 'Rounded Container Corners',
|
510 |
+
'tooltip' => 'Switch on to enable rounded corners for your share container',
|
511 |
+
'value' => 'Y',
|
512 |
+
'checked' => isset( $arr_settings['ssba_div_rounded_corners'] ) && 'Y' === $arr_settings['ssba_div_rounded_corners'] ? esc_attr( 'checked' ) : '',
|
513 |
+
);
|
514 |
+
|
515 |
+
// Share count.
|
516 |
+
$opts19 = array(
|
517 |
+
'form_group' => false,
|
518 |
+
'type' => 'checkbox',
|
519 |
+
'name' => 'ssba_show_share_count',
|
520 |
+
'label' => 'Share Count',
|
521 |
+
'tooltip' => 'Check the box if you wish to enable share counts. Enabling this option will slow down the loading of any pages that use share buttons',
|
522 |
+
'value' => 'Y',
|
523 |
+
'checked' => isset( $arr_settings['ssba_show_share_count'] ) && 'Y' === $arr_settings['ssba_show_share_count'] ? esc_attr( 'checked' ) : null,
|
524 |
+
);
|
525 |
+
|
526 |
+
// Share count for plus.
|
527 |
+
$opts19p = array(
|
528 |
+
'form_group' => false,
|
529 |
+
'type' => 'checkbox',
|
530 |
+
'name' => 'ssba_plus_show_share_count',
|
531 |
+
'label' => 'Share Count',
|
532 |
+
'tooltip' => 'Check the box if you wish to enable share counts. Enabling this option will slow down the loading of any pages that use share buttons',
|
533 |
+
'value' => 'Y',
|
534 |
+
'checked' => isset( $arr_settings['ssba_plus_show_share_count'] ) && 'Y' === $arr_settings['ssba_plus_show_share_count'] ? esc_attr( 'checked' ) : null,
|
535 |
+
);
|
536 |
+
|
537 |
+
// Share count for share bar.
|
538 |
+
$opts19s = array(
|
539 |
+
'form_group' => false,
|
540 |
+
'type' => 'checkbox',
|
541 |
+
'name' => 'ssba_bar_show_share_count',
|
542 |
+
'label' => 'Share Count',
|
543 |
+
'tooltip' => 'Check the box if you wish to enable share counts. Enabling this option will slow down the loading of any pages that use share buttons',
|
544 |
+
'value' => 'Y',
|
545 |
+
'checked' => isset( $arr_settings['ssba_bar_show_share_count'] ) && 'Y' === $arr_settings['ssba_bar_show_share_count'] ? esc_attr( 'checked' ) : null,
|
546 |
+
);
|
547 |
+
|
548 |
+
// Show count once.
|
549 |
+
$opts20 = array(
|
550 |
+
'form_group' => false,
|
551 |
+
'type' => 'checkbox',
|
552 |
+
'name' => 'ssba_share_count_once',
|
553 |
+
'label' => 'Show Once',
|
554 |
+
'tooltip' => 'This option is recommended, it deactivates share counts for categories and archives allowing them to load more quickly',
|
555 |
+
'value' => 'Y',
|
556 |
+
'checked' => isset( $arr_settings['ssba_share_count_once'] ) && 'Y' === $arr_settings['ssba_share_count_once'] ? esc_attr( 'checked' ) : null,
|
557 |
+
);
|
558 |
+
|
559 |
+
// Show count once for plus.
|
560 |
+
$opts20p = array(
|
561 |
+
'form_group' => false,
|
562 |
+
'type' => 'checkbox',
|
563 |
+
'name' => 'ssba_plus_share_count_once',
|
564 |
+
'label' => 'Show Once',
|
565 |
+
'tooltip' => 'This option is recommended, it deactivates share counts for categories and archives allowing them to load more quickly',
|
566 |
+
'value' => 'Y',
|
567 |
+
'checked' => isset( $arr_settings['ssba_plus_share_count_once'] ) && 'Y' === $arr_settings['ssba_plus_share_count_once'] ? esc_attr( 'checked' ) : null,
|
568 |
+
);
|
569 |
+
|
570 |
+
// Show count once for share bar.
|
571 |
+
$opts20s = array(
|
572 |
+
'form_group' => false,
|
573 |
+
'type' => 'checkbox',
|
574 |
+
'name' => 'ssba_bar_share_count_once',
|
575 |
+
'label' => 'Show Once',
|
576 |
+
'tooltip' => 'This option is recommended, it deactivates share counts for categories and archives allowing them to load more quickly',
|
577 |
+
'value' => 'Y',
|
578 |
+
'checked' => isset( $arr_settings['ssba_bar_share_count_once'] ) && 'Y' === $arr_settings['ssba_bar_share_count_once'] ? esc_attr( 'checked' ) : null,
|
579 |
+
);
|
580 |
+
|
581 |
+
// Share counters style.
|
582 |
+
$opts21 = array(
|
583 |
+
'form_group' => false,
|
584 |
+
'type' => 'select',
|
585 |
+
'name' => 'ssba_share_count_style',
|
586 |
+
'label' => 'Counters Style',
|
587 |
+
'tooltip' => 'Pick a setting to style the share counters',
|
588 |
+
'selected' => isset( $arr_settings['ssba_share_count_style'] ) ? $arr_settings['ssba_share_count_style'] : '',
|
589 |
+
'options' => array(
|
590 |
+
'Default' => 'default',
|
591 |
+
'White' => 'white',
|
592 |
+
'Blue' => 'blue',
|
593 |
+
),
|
594 |
+
);
|
595 |
+
|
596 |
+
// Sharedcount enable.
|
597 |
+
$opts23 = array(
|
598 |
+
'form_group' => false,
|
599 |
+
'type' => 'checkbox',
|
600 |
+
'name' => 'sharedcount_enabled',
|
601 |
+
'label' => 'Enable sharedcount.com API',
|
602 |
+
'tooltip' => 'Enable if you wish to enable the use of the sharedcount.com API',
|
603 |
+
'value' => 'Y',
|
604 |
+
'checked' => isset( $arr_settings['sharedcount_enabled'] ) && 'Y' === $arr_settings['sharedcount_enabled'] ? esc_attr( 'checked' ) : null,
|
605 |
+
);
|
606 |
+
|
607 |
+
// Sharedcount plan.
|
608 |
+
$opts24 = array(
|
609 |
+
'form_group' => false,
|
610 |
+
'type' => 'select',
|
611 |
+
'name' => 'sharedcount_plan',
|
612 |
+
'label' => 'sharedcount.com plan',
|
613 |
+
'tooltip' => 'Select your sharedcount.com plan',
|
614 |
+
'selected' => isset( $arr_settings['sharedcount_plan'] ) ? $arr_settings['sharedcount_plan'] : '',
|
615 |
+
'options' => array(
|
616 |
+
'Free' => 'free',
|
617 |
+
'Plus' => 'plus',
|
618 |
+
'Business' => 'business',
|
619 |
+
),
|
620 |
+
);
|
621 |
+
|
622 |
+
// Sharedcount api key.
|
623 |
+
$opts25 = array(
|
624 |
+
'form_group' => false,
|
625 |
+
'type' => 'text',
|
626 |
+
'placeholder' => '9b17c12712c691491ef95f46c51ce3917118fdf9',
|
627 |
+
'name' => 'sharedcount_api_key',
|
628 |
+
'label' => 'sharedcount.com API Key',
|
629 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
630 |
+
'value' => isset( $arr_settings['sharedcount_api_key'] ) ? $arr_settings['sharedcount_api_key'] : '',
|
631 |
+
);
|
632 |
+
|
633 |
+
// Sharedcount enable.
|
634 |
+
$opts23p = array(
|
635 |
+
'form_group' => false,
|
636 |
+
'type' => 'checkbox',
|
637 |
+
'name' => 'plus_sharedcount_enabled',
|
638 |
+
'label' => 'Enable sharedcount.com API',
|
639 |
+
'tooltip' => 'Enable if you wish to enable the use of the sharedcount.com API',
|
640 |
+
'value' => 'Y',
|
641 |
+
'checked' => isset( $arr_settings['plus_sharedcount_enabled'] ) && 'Y' === $arr_settings['plus_sharedcount_enabled'] ? esc_attr( 'checked' ) : null,
|
642 |
+
);
|
643 |
+
|
644 |
+
// Sharedcount plan.
|
645 |
+
$opts24p = array(
|
646 |
+
'form_group' => false,
|
647 |
+
'type' => 'select',
|
648 |
+
'name' => 'plus_sharedcount_plan',
|
649 |
+
'label' => 'sharedcount.com plan',
|
650 |
+
'tooltip' => 'Select your sharedcount.com plan',
|
651 |
+
'selected' => isset( $arr_settings['plus_sharedcount_plan'] ) ? $arr_settings['plus_sharedcount_plan'] : '',
|
652 |
+
'options' => array(
|
653 |
+
'Free' => 'free',
|
654 |
+
'Plus' => 'plus',
|
655 |
+
'Business' => 'business',
|
656 |
+
),
|
657 |
+
);
|
658 |
+
|
659 |
+
// Sharedcount api key.
|
660 |
+
$opts25p = array(
|
661 |
+
'form_group' => false,
|
662 |
+
'type' => 'text',
|
663 |
+
'placeholder' => '9b17c12712c691491ef95f46c51ce3917118fdf9',
|
664 |
+
'name' => 'plus_sharedcount_api_key',
|
665 |
+
'label' => 'sharedcount.com API Key',
|
666 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
667 |
+
'value' => isset( $arr_settings['plus_sharedcount_api_key'] ) ? $arr_settings['plus_sharedcount_api_key'] : '',
|
668 |
+
);
|
669 |
+
|
670 |
+
// Sharedcount enable.
|
671 |
+
$opts23b = array(
|
672 |
+
'form_group' => false,
|
673 |
+
'type' => 'checkbox',
|
674 |
+
'name' => 'bar_sharedcount_enabled',
|
675 |
+
'label' => 'Enable sharedcount.com API',
|
676 |
+
'tooltip' => 'Enable if you wish to enable the use of the sharedcount.com API',
|
677 |
+
'value' => 'Y',
|
678 |
+
'checked' => isset( $arr_settings['bar_sharedcount_enabled'] ) && 'Y' === $arr_settings['bar_sharedcount_enabled'] ? esc_attr( 'checked' ) : null,
|
679 |
+
);
|
680 |
+
|
681 |
+
// Sharedcount plan.
|
682 |
+
$opts24b = array(
|
683 |
+
'form_group' => false,
|
684 |
+
'type' => 'select',
|
685 |
+
'name' => 'bar_sharedcount_plan',
|
686 |
+
'label' => 'sharedcount.com plan',
|
687 |
+
'tooltip' => 'Select your sharedcount.com plan',
|
688 |
+
'selected' => isset( $arr_settings['bar_sharedcount_plan'] ) ? $arr_settings['bar_sharedcount_plan'] : '',
|
689 |
+
'options' => array(
|
690 |
+
'Free' => 'free',
|
691 |
+
'Plus' => 'plus',
|
692 |
+
'Business' => 'business',
|
693 |
+
),
|
694 |
+
);
|
695 |
+
|
696 |
+
// Sharedcount api key.
|
697 |
+
$opts25b = array(
|
698 |
+
'form_group' => false,
|
699 |
+
'type' => 'text',
|
700 |
+
'placeholder' => '9b17c12712c691491ef95f46c51ce3917118fdf9',
|
701 |
+
'name' => 'bar_sharedcount_api_key',
|
702 |
+
'label' => 'sharedcount.com API Key',
|
703 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
704 |
+
'value' => isset( $arr_settings['bar_sharedcount_api_key'] ) ? $arr_settings['bar_sharedcount_api_key'] : '',
|
705 |
+
);
|
706 |
+
|
707 |
+
// Link to ssb.
|
708 |
+
$opts26 = array(
|
709 |
+
'form_group' => false,
|
710 |
+
'type' => 'checkbox',
|
711 |
+
'name' => 'ssba_link_to_ssb',
|
712 |
+
'label' => 'Share Text Link',
|
713 |
+
'tooltip' => 'Enabling this will set your share text as a link to simplesharebuttons.com to help others learn of the plugin',
|
714 |
+
'value' => 'Y',
|
715 |
+
'checked' => isset( $arr_settings['ssba_link_to_ssb'] ) && 'Y' === $arr_settings['ssba_link_to_ssb'] ? esc_attr( 'checked' ) : null,
|
716 |
+
);
|
717 |
+
|
718 |
+
// Link to ssb for plus.
|
719 |
+
$opts26p = array(
|
720 |
+
'form_group' => false,
|
721 |
+
'type' => 'checkbox',
|
722 |
+
'name' => 'ssba_plus_link_to_ssb',
|
723 |
+
'label' => 'Share Text Link',
|
724 |
+
'tooltip' => 'Enabling this will set your share text as a link to simplesharebuttons.com to help others learn of the plugin',
|
725 |
+
'value' => 'Y',
|
726 |
+
'checked' => isset( $arr_settings['ssba_plus_link_to_ssb'] ) && 'Y' === $arr_settings['ssba_plus_link_to_ssb'] ? esc_attr( 'checked' ) : null,
|
727 |
+
);
|
728 |
+
|
729 |
+
// Content priority.
|
730 |
+
$opts27 = array(
|
731 |
+
'form_group' => false,
|
732 |
+
'type' => 'number',
|
733 |
+
'placeholder' => '10',
|
734 |
+
'name' => 'ssba_content_priority',
|
735 |
+
'label' => 'Content Priority',
|
736 |
+
'tooltip' => 'Set the priority for your share buttons within your content. 1-10, default is 10',
|
737 |
+
'value' => isset( $arr_settings['ssba_content_priority'] ) ? $arr_settings['ssba_content_priority'] : '',
|
738 |
+
);
|
739 |
+
|
740 |
+
// Share in new window.
|
741 |
+
$opts28 = array(
|
742 |
+
'form_group' => false,
|
743 |
+
'type' => 'checkbox',
|
744 |
+
'name' => 'ssba_share_new_window',
|
745 |
+
'label' => 'Open links in a new window',
|
746 |
+
'tooltip' => 'Disabling this will make links open in the same window',
|
747 |
+
'value' => 'Y',
|
748 |
+
'checked' => isset( $arr_settings['ssba_share_new_window'] ) && 'Y' === $arr_settings['ssba_share_new_window'] ? esc_attr( 'checked' ) : null,
|
749 |
+
);
|
750 |
+
|
751 |
+
// Share in new window for plus.
|
752 |
+
$opts28p = array(
|
753 |
+
'form_group' => false,
|
754 |
+
'type' => 'checkbox',
|
755 |
+
'name' => 'ssba_plus_share_new_window',
|
756 |
+
'label' => 'Open links in a new window',
|
757 |
+
'tooltip' => 'Disabling this will make links open in the same window',
|
758 |
+
'value' => 'Y',
|
759 |
+
'checked' => isset( $arr_settings['ssba_plus_share_new_window'] ) && 'Y' === $arr_settings['ssba_plus_share_new_window'] ? esc_attr( 'checked' ) : null,
|
760 |
+
);
|
761 |
+
|
762 |
+
// Share in new window for share bar.
|
763 |
+
$opts28s = array(
|
764 |
+
'form_group' => false,
|
765 |
+
'type' => 'checkbox',
|
766 |
+
'name' => 'ssba_bar_share_new_window',
|
767 |
+
'label' => 'Open links in a new window',
|
768 |
+
'tooltip' => 'Disabling this will make links open in the same window',
|
769 |
+
'value' => 'Y',
|
770 |
+
'checked' => isset( $arr_settings['ssba_bar_share_new_window'] ) && 'Y' === $arr_settings['ssba_bar_share_new_window'] ? esc_attr( 'checked' ) : null,
|
771 |
+
);
|
772 |
+
|
773 |
+
// Nofollow.
|
774 |
+
$opts29 = array(
|
775 |
+
'form_group' => false,
|
776 |
+
'type' => 'checkbox',
|
777 |
+
'name' => 'ssba_rel_nofollow',
|
778 |
+
'label' => 'Add rel="nofollow"',
|
779 |
+
'tooltip' => 'Enable this to add nofollow to all share links',
|
780 |
+
'value' => 'Y',
|
781 |
+
'checked' => isset( $arr_settings['ssba_rel_nofollow'] ) && 'Y' === $arr_settings['ssba_rel_nofollow'] ? esc_attr( 'checked' ) : null,
|
782 |
+
);
|
783 |
+
|
784 |
+
// Nofollow for plus.
|
785 |
+
$opts29p = array(
|
786 |
+
'form_group' => false,
|
787 |
+
'type' => 'checkbox',
|
788 |
+
'name' => 'ssba_plus_rel_nofollow',
|
789 |
+
'label' => 'Add rel="nofollow"',
|
790 |
+
'tooltip' => 'Enable this to add nofollow to all share links',
|
791 |
+
'value' => 'Y',
|
792 |
+
'checked' => isset( $arr_settings['ssba_plus_rel_nofollow'] ) && 'Y' === $arr_settings['ssba_plus_rel_nofollow'] ? esc_attr( 'checked' ) : null,
|
793 |
+
);
|
794 |
+
|
795 |
+
// Nofollow for share bar.
|
796 |
+
$opts29s = array(
|
797 |
+
'form_group' => false,
|
798 |
+
'type' => 'checkbox',
|
799 |
+
'name' => 'ssba_bar_rel_nofollow',
|
800 |
+
'label' => 'Add rel="nofollow"',
|
801 |
+
'tooltip' => 'Enable this to add nofollow to all share links',
|
802 |
+
'value' => 'Y',
|
803 |
+
'checked' => isset( $arr_settings['ssba_bar_rel_nofollow'] ) && 'Y' === $arr_settings['ssba_bar_rel_nofollow'] ? esc_attr( 'checked' ) : null,
|
804 |
+
);
|
805 |
+
|
806 |
+
// Widget share text.
|
807 |
+
$opts30 = array(
|
808 |
+
'form_group' => false,
|
809 |
+
'type' => 'text',
|
810 |
+
'placeholder' => 'Keeping sharing simple...',
|
811 |
+
'name' => 'ssba_widget_text',
|
812 |
+
'label' => 'Widget Share Text',
|
813 |
+
'tooltip' => 'Add custom share text when used as a widget',
|
814 |
+
'value' => isset( $arr_settings['ssba_widget_text'] ) ? $arr_settings['ssba_widget_text'] : '',
|
815 |
+
);
|
816 |
+
|
817 |
+
// Widget share text for plus.
|
818 |
+
$opts30p = array(
|
819 |
+
'form_group' => false,
|
820 |
+
'type' => 'text',
|
821 |
+
'placeholder' => 'Keeping sharing simple...',
|
822 |
+
'name' => 'ssba_plus_widget_text',
|
823 |
+
'label' => 'Widget Share Text',
|
824 |
+
'tooltip' => 'Add custom share text when used as a widget',
|
825 |
+
'value' => isset( $arr_settings['ssba_plus_widget_text'] ) ? $arr_settings['ssba_plus_widget_text'] : '',
|
826 |
+
);
|
827 |
+
|
828 |
+
// Email share text.
|
829 |
+
$opts31 = array(
|
830 |
+
'form_group' => false,
|
831 |
+
'type' => 'text',
|
832 |
+
'placeholder' => 'Share by email...',
|
833 |
+
'name' => 'ssba_email_message',
|
834 |
+
'label' => 'Email Text',
|
835 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
836 |
+
'value' => isset( $arr_settings['ssba_email_message'] ) ? $arr_settings['ssba_email_message'] : '',
|
837 |
+
);
|
838 |
+
|
839 |
+
// Email share text for plus.
|
840 |
+
$opts31p = array(
|
841 |
+
'form_group' => false,
|
842 |
+
'type' => 'text',
|
843 |
+
'placeholder' => 'Share by email...',
|
844 |
+
'name' => 'ssba_plus_email_message',
|
845 |
+
'label' => 'Email Text',
|
846 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
847 |
+
'value' => isset( $arr_settings['ssba_plus_email_message'] ) ? $arr_settings['ssba_plus_email_message'] : '',
|
848 |
+
);
|
849 |
+
|
850 |
+
// Email share text for share bar.
|
851 |
+
$opts31s = array(
|
852 |
+
'form_group' => false,
|
853 |
+
'type' => 'text',
|
854 |
+
'placeholder' => 'Share by email...',
|
855 |
+
'name' => 'ssba_bar_email_message',
|
856 |
+
'label' => 'Email Text',
|
857 |
+
'tooltip' => 'Add some text included in an email when people share that way',
|
858 |
+
'value' => isset( $arr_settings['ssba_bar_email_message'] ) ? $arr_settings['ssba_bar_email_message'] : '',
|
859 |
+
);
|
860 |
+
|
861 |
+
// Facebook app id.
|
862 |
+
$opts32 = array(
|
863 |
+
'form_group' => false,
|
864 |
+
'type' => 'text',
|
865 |
+
'placeholder' => '123456789123',
|
866 |
+
'name' => 'facebook_app_id',
|
867 |
+
'label' => 'Facebook App ID',
|
868 |
+
'tooltip' => 'Enter your Facebook App ID, e.g. 123456789123',
|
869 |
+
'value' => isset( $arr_settings['facebook_app_id'] ) ? $arr_settings['facebook_app_id'] : '',
|
870 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? esc_attr( 'disabled' ) : null,
|
871 |
+
);
|
872 |
+
|
873 |
+
// Facebook app id for plus.
|
874 |
+
$opts32p = array(
|
875 |
+
'form_group' => false,
|
876 |
+
'type' => 'text',
|
877 |
+
'placeholder' => '123456789123',
|
878 |
+
'name' => 'plus_facebook_app_id',
|
879 |
+
'label' => 'Facebook App ID',
|
880 |
+
'tooltip' => 'Enter your Facebook App ID, e.g. 123456789123',
|
881 |
+
'value' => isset( $arr_settings['plus_facebook_app_id'] ) ? $arr_settings['plus_facebook_app_id'] : '',
|
882 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? esc_attr( 'disabled' ) : null,
|
883 |
+
);
|
884 |
+
|
885 |
+
// Facebook app id for share bar.
|
886 |
+
$opts32s = array(
|
887 |
+
'form_group' => false,
|
888 |
+
'type' => 'text',
|
889 |
+
'placeholder' => '123456789123',
|
890 |
+
'name' => 'share_facebook_app_id',
|
891 |
+
'label' => 'Facebook App ID',
|
892 |
+
'tooltip' => 'Enter your Facebook App ID, e.g. 123456789123',
|
893 |
+
'value' => isset( $arr_settings['bar_facebook_app_id'] ) ? $arr_settings['bar_facebook_app_id'] : '',
|
894 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? esc_attr( 'disabled' ) : null,
|
895 |
+
);
|
896 |
+
|
897 |
+
// Facebook insights.
|
898 |
+
$opts33 = array(
|
899 |
+
'form_group' => false,
|
900 |
+
'type' => 'checkbox',
|
901 |
+
'name' => 'facebook_insights',
|
902 |
+
'label' => 'Facebook Insights',
|
903 |
+
'tooltip' => 'Enable this feature to enable Facebook Insights',
|
904 |
+
'value' => 'Y',
|
905 |
+
'checked' => isset( $arr_settings['facebook_insights'] ) && 'Y' === $arr_settings['facebook_insights'] ? 'checked' : null,
|
906 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? 'disabled' : null,
|
907 |
+
);
|
908 |
+
|
909 |
+
// Ignore sdk.
|
910 |
+
$ignore_sdk = array(
|
911 |
+
'form_group' => false,
|
912 |
+
'type' => 'checkbox',
|
913 |
+
'name' => 'ignore_facebook_sdk',
|
914 |
+
'label' => 'Ignore FB SDK',
|
915 |
+
'tooltip' => 'Using you\'re own Facebook SDK? Ignore ours.',
|
916 |
+
'value' => 'Y',
|
917 |
+
'checked' => isset( $arr_settings['ignore_facebook_sdk'] ) && 'Y' === $arr_settings['ignore_facebook_sdk'] ? esc_attr( 'checked' ) : '',
|
918 |
+
);
|
919 |
+
|
920 |
+
// Facebook insights for plus.
|
921 |
+
$opts33p = array(
|
922 |
+
'form_group' => false,
|
923 |
+
'type' => 'checkbox',
|
924 |
+
'name' => 'plus_facebook_insights',
|
925 |
+
'label' => 'Facebook Insights',
|
926 |
+
'tooltip' => 'Enable this feature to enable Facebook Insights',
|
927 |
+
'value' => 'Y',
|
928 |
+
'checked' => isset( $arr_settings['plus_facebook_insights'] ) && 'Y' === $arr_settings['plus_facebook_insights'] ? 'checked' : null,
|
929 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? 'disabled' : null,
|
930 |
+
);
|
931 |
+
|
932 |
+
// Plus ignore sdk.
|
933 |
+
$plus_ignore_sdk = array(
|
934 |
+
'form_group' => false,
|
935 |
+
'type' => 'checkbox',
|
936 |
+
'name' => 'plus_ignore_facebook_sdk',
|
937 |
+
'label' => 'Ignore FB SDK',
|
938 |
+
'tooltip' => 'Using you\'re own Facebook SDK? Ignore ours.',
|
939 |
+
'value' => 'Y',
|
940 |
+
'checked' => isset( $arr_settings['plus_ignore_facebook_sdk'] ) && 'Y' === $arr_settings['plus_ignore_facebook_sdk'] ? esc_attr( 'checked' ) : '',
|
941 |
+
);
|
942 |
+
|
943 |
+
// Facebook insights for share bar.
|
944 |
+
$opts33s = array(
|
945 |
+
'form_group' => false,
|
946 |
+
'type' => 'checkbox',
|
947 |
+
'name' => 'share_facebook_insights',
|
948 |
+
'label' => 'Facebook Insights',
|
949 |
+
'tooltip' => 'Enable this feature to enable Facebook Insights',
|
950 |
+
'value' => 'Y',
|
951 |
+
'checked' => isset( $arr_settings['bar_facebook_insights'] ) && 'Y' === $arr_settings['bar_facebook_insights'] ? 'checked' : null,
|
952 |
+
'disabled' => 'Y' !== $arr_settings['accepted_sharethis_terms'] ? 'disabled' : null,
|
953 |
+
);
|
954 |
+
|
955 |
+
// Twitter share text.
|
956 |
+
$opts34 = array(
|
957 |
+
'form_group' => false,
|
958 |
+
'type' => 'text',
|
959 |
+
'placeholder' => 'Shared by Twitter...',
|
960 |
+
'name' => 'ssba_twitter_text',
|
961 |
+
'label' => 'Twitter Text',
|
962 |
+
'tooltip' => 'Add some custom text for when people share via Twitter',
|
963 |
+
'value' => isset( $arr_settings['ssba_twitter_text'] ) ? $arr_settings['ssba_twitter_text'] : '',
|
964 |
+
);
|
965 |
+
|
966 |
+
// Twitter share text for plus.
|
967 |
+
$opts34p = array(
|
968 |
+
'form_group' => false,
|
969 |
+
'type' => 'text',
|
970 |
+
'placeholder' => 'Shared by Twitter...',
|
971 |
+
'name' => 'ssba_plus_twitter_text',
|
972 |
+
'label' => 'Twitter Text',
|
973 |
+
'tooltip' => 'Add some custom text for when people share via Twitter',
|
974 |
+
'value' => isset( $arr_settings['ssba_plus_twitter_text'] ) ? $arr_settings['ssba_plus_twitter_text'] : '',
|
975 |
+
);
|
976 |
+
|
977 |
+
// Twitter share text for share bar.
|
978 |
+
$opts34s = array(
|
979 |
+
'form_group' => false,
|
980 |
+
'type' => 'text',
|
981 |
+
'placeholder' => 'Shared by Twitter...',
|
982 |
+
'name' => 'ssba_bar_twitter_text',
|
983 |
+
'label' => 'Twitter Text',
|
984 |
+
'tooltip' => 'Add some custom text for when people share via Twitter',
|
985 |
+
'value' => isset( $arr_settings['ssba_bar_twitter_text'] ) ? $arr_settings['ssba_bar_twitter_text'] : '',
|
986 |
+
);
|
987 |
+
|
988 |
+
// Flattr user id.
|
989 |
+
$opts35 = array(
|
990 |
+
'form_group' => false,
|
991 |
+
'type' => 'text',
|
992 |
+
'placeholder' => 'davidsneal',
|
993 |
+
'name' => 'ssba_flattr_user_id',
|
994 |
+
'label' => 'Flattr User ID',
|
995 |
+
'tooltip' => 'Enter your Flattr ID, e.g. davidsneal',
|
996 |
+
'value' => isset( $arr_settings['ssba_flattr_user_id'] ) ? $arr_settings['ssba_flattr_user_id'] : '',
|
997 |
+
);
|
998 |
+
|
999 |
+
// Flattr user id for plus.
|
1000 |
+
$opts35p = array(
|
1001 |
+
'form_group' => false,
|
1002 |
+
'type' => 'text',
|
1003 |
+
'placeholder' => 'davidsneal',
|
1004 |
+
'name' => 'ssba_plus_flattr_user_id',
|
1005 |
+
'label' => 'Flattr User ID',
|
1006 |
+
'tooltip' => 'Enter your Flattr ID, e.g. davidsneal',
|
1007 |
+
'value' => isset( $arr_settings['ssba_plus_flattr_user_id'] ) ? $arr_settings['ssba_plus_flattr_user_id'] : '',
|
1008 |
+
);
|
1009 |
+
|
1010 |
+
// Flattr user id for share bar.
|
1011 |
+
$opts35s = array(
|
1012 |
+
'form_group' => false,
|
1013 |
+
'type' => 'text',
|
1014 |
+
'placeholder' => 'davidsneal',
|
1015 |
+
'name' => 'ssba_bar_flattr_user_id',
|
1016 |
+
'label' => 'Flattr User ID',
|
1017 |
+
'tooltip' => 'Enter your Flattr ID, e.g. davidsneal',
|
1018 |
+
'value' => isset( $arr_settings['ssba_bar_flattr_user_id'] ) ? $arr_settings['ssba_bar_flattr_user_id'] : '',
|
1019 |
+
);
|
1020 |
+
|
1021 |
+
// Flattr url.
|
1022 |
+
$opts36 = array(
|
1023 |
+
'form_group' => false,
|
1024 |
+
'type' => 'text',
|
1025 |
+
'placeholder' => 'flattr.com/@username',
|
1026 |
+
'name' => 'ssba_flattr_url',
|
1027 |
+
'label' => 'Flattr URL',
|
1028 |
+
'tooltip' => 'This option is perfect for dedicated sites, e.g. https://simplesharebuttons.com',
|
1029 |
+
'value' => isset( $arr_settings['ssba_flattr_url'] ) ? $arr_settings['ssba_flattr_url'] : '',
|
1030 |
+
);
|
1031 |
+
|
1032 |
+
// Flattr url for plus.
|
1033 |
+
$opts36p = array(
|
1034 |
+
'form_group' => false,
|
1035 |
+
'type' => 'text',
|
1036 |
+
'placeholder' => 'flattr.com/@username',
|
1037 |
+
'name' => 'ssba_plus_flattr_url',
|
1038 |
+
'label' => 'Flattr URL',
|
1039 |
+
'tooltip' => 'This option is perfect for dedicated sites, e.g. https://simplesharebuttons.com',
|
1040 |
+
'value' => isset( $arr_settings['ssba_plus_flattr_url'] ) ? $arr_settings['ssba_plus_flattr_url'] : '',
|
1041 |
+
);
|
1042 |
+
|
1043 |
+
// Flattr url for share bar.
|
1044 |
+
$opts36s = array(
|
1045 |
+
'form_group' => false,
|
1046 |
+
'type' => 'text',
|
1047 |
+
'placeholder' => 'flattr.com/@username',
|
1048 |
+
'name' => 'ssba_bar_flattr_url',
|
1049 |
+
'label' => 'Flattr URL',
|
1050 |
+
'tooltip' => 'This option is perfect for dedicated sites, e.g. https://simplesharebuttons.com',
|
1051 |
+
'value' => isset( $arr_settings['ssba_bar_flattr_url'] ) ? $arr_settings['ssba_bar_flattr_url'] : '',
|
1052 |
+
);
|
1053 |
+
|
1054 |
+
// Buffer text.
|
1055 |
+
$opts37 = array(
|
1056 |
+
'form_group' => false,
|
1057 |
+
'type' => 'text',
|
1058 |
+
'placeholder' => 'Shared by Buffer...',
|
1059 |
+
'name' => 'ssba_buffer_text',
|
1060 |
+
'label' => 'Custom Buffer Text',
|
1061 |
+
'tooltip' => 'Add some custom text for when people share via Buffer',
|
1062 |
+
'value' => isset( $arr_settings['ssba_buffer_text'] ) ? $arr_settings['ssba_buffer_text'] : '',
|
1063 |
+
);
|
1064 |
+
|
1065 |
+
// Buffer text for plus.
|
1066 |
+
$opts37p = array(
|
1067 |
+
'form_group' => false,
|
1068 |
+
'type' => 'text',
|
1069 |
+
'placeholder' => 'Shared by Buffer...',
|
1070 |
+
'name' => 'ssba_plus_buffer_text',
|
1071 |
+
'label' => 'Custom Buffer Text',
|
1072 |
+
'tooltip' => 'Add some custom text for when people share via Buffer',
|
1073 |
+
'value' => isset( $arr_settings['ssba_plus_buffer_text'] ) ? $arr_settings['ssba_plus_buffer_text'] : '',
|
1074 |
+
);
|
1075 |
+
|
1076 |
+
// Buffer text for share bar.
|
1077 |
+
$opts37s = array(
|
1078 |
+
'form_group' => false,
|
1079 |
+
'type' => 'text',
|
1080 |
+
'placeholder' => 'Shared by Buffer...',
|
1081 |
+
'name' => 'ssba_bar_buffer_text',
|
1082 |
+
'label' => 'Custom Buffer Text',
|
1083 |
+
'tooltip' => 'Add some custom text for when people share via Buffer',
|
1084 |
+
'value' => isset( $arr_settings['ssba_bar_buffer_text'] ) ? $arr_settings['ssba_bar_buffer_text'] : '',
|
1085 |
+
);
|
1086 |
+
|
1087 |
+
// Pin featured images.
|
1088 |
+
$opts38 = array(
|
1089 |
+
'form_group' => false,
|
1090 |
+
'type' => 'checkbox',
|
1091 |
+
'name' => 'ssba_pinterest_featured',
|
1092 |
+
'label' => 'Pin Featured Images',
|
1093 |
+
'tooltip' => 'Force the use of featured images for posts/pages when pinning',
|
1094 |
+
'value' => 'Y',
|
1095 |
+
'checked' => isset( $arr_settings['ssba_pinterest_featured'] ) && 'Y' === $arr_settings['ssba_pinterest_featured'] ? 'checked' : null,
|
1096 |
+
);
|
1097 |
+
|
1098 |
+
// Pin featured images for plus.
|
1099 |
+
$opts38p = array(
|
1100 |
+
'form_group' => false,
|
1101 |
+
'type' => 'checkbox',
|
1102 |
+
'name' => 'ssba_plus_pinterest_featured',
|
1103 |
+
'label' => 'Pin Featured Images',
|
1104 |
+
'tooltip' => 'Force the use of featured images for posts/pages when pinning',
|
1105 |
+
'value' => 'Y',
|
1106 |
+
'checked' => isset( $arr_settings['ssba_plus_pinterest_featured'] ) && 'Y' === $arr_settings['ssba_plus_pinterest_featured'] ? 'checked' : null,
|
1107 |
+
);
|
1108 |
+
|
1109 |
+
// Pin featured images for share bar.
|
1110 |
+
$opts38s = array(
|
1111 |
+
'form_group' => false,
|
1112 |
+
'type' => 'checkbox',
|
1113 |
+
'name' => 'ssba_bar_pinterest_featured',
|
1114 |
+
'label' => 'Pin Featured Images',
|
1115 |
+
'tooltip' => 'Force the use of featured images for posts/pages when pinning',
|
1116 |
+
'value' => 'Y',
|
1117 |
+
'checked' => isset( $arr_settings['ssba_bar_pinterest_featured'] ) && 'Y' === $arr_settings['ssba_bar_pinterest_featured'] ? 'checked' : null,
|
1118 |
+
);
|
1119 |
+
|
1120 |
+
// Default pinterest image.
|
1121 |
+
$opts39 = array(
|
1122 |
+
'form_group' => false,
|
1123 |
+
'type' => 'image_upload',
|
1124 |
+
'name' => 'ssba_default_pinterest',
|
1125 |
+
'label' => 'Default Pinterest Image',
|
1126 |
+
'tooltip' => 'Upload a default Pinterest image',
|
1127 |
+
'value' => isset( $arr_settings['ssba_default_pinterest'] ) ? $arr_settings['ssba_default_pinterest'] : '',
|
1128 |
+
);
|
1129 |
+
|
1130 |
+
// Default pinterest image for plus.
|
1131 |
+
$opts39p = array(
|
1132 |
+
'form_group' => false,
|
1133 |
+
'type' => 'image_upload',
|
1134 |
+
'name' => 'ssba_plus_default_pinterest',
|
1135 |
+
'label' => 'Default Pinterest Image',
|
1136 |
+
'tooltip' => 'Upload a default Pinterest image',
|
1137 |
+
'value' => isset( $arr_settings['ssba_plus_default_pinterest'] ) ? $arr_settings['ssba_plus_default_pinterest'] : '',
|
1138 |
+
);
|
1139 |
+
|
1140 |
+
// Default pinterest image for share bar.
|
1141 |
+
$opts39s = array(
|
1142 |
+
'form_group' => false,
|
1143 |
+
'type' => 'image_upload',
|
1144 |
+
'name' => 'ssba_bar_default_pinterest',
|
1145 |
+
'label' => 'Default Pinterest Image',
|
1146 |
+
'tooltip' => 'Upload a default Pinterest image',
|
1147 |
+
'value' => isset( $arr_settings['ssba_bar_default_pinterest'] ) ? $arr_settings['ssba_bar_default_pinterest'] : '',
|
1148 |
+
);
|
1149 |
+
|
1150 |
+
// Additional css.
|
1151 |
+
$opts40 = array(
|
1152 |
+
'form_group' => false,
|
1153 |
+
'type' => 'textarea',
|
1154 |
+
'rows' => '15',
|
1155 |
+
'class' => 'code-font',
|
1156 |
+
'name' => 'ssba_additional_css',
|
1157 |
+
'label' => 'Additional CSS',
|
1158 |
+
'tooltip' => 'Add your own additional CSS if you wish',
|
1159 |
+
'value' => isset( $arr_settings['ssba_additional_css'] ) ? $arr_settings['ssba_additional_css'] : '',
|
1160 |
+
);
|
1161 |
+
|
1162 |
+
// Additional css for plus.
|
1163 |
+
$opts40p = array(
|
1164 |
+
'form_group' => false,
|
1165 |
+
'type' => 'textarea',
|
1166 |
+
'rows' => '15',
|
1167 |
+
'class' => 'code-font',
|
1168 |
+
'name' => 'ssba_plus_additional_css',
|
1169 |
+
'label' => 'Additional CSS',
|
1170 |
+
'tooltip' => 'Add your own additional CSS if you wish',
|
1171 |
+
'value' => isset( $arr_settings['ssba_plus_additional_css'] ) ? $arr_settings['ssba_plus_additional_css'] : '',
|
1172 |
+
);
|
1173 |
+
|
1174 |
+
// Additional css for share.
|
1175 |
+
$opts40s = array(
|
1176 |
+
'form_group' => false,
|
1177 |
+
'type' => 'textarea',
|
1178 |
+
'rows' => '15',
|
1179 |
+
'class' => 'code-font',
|
1180 |
+
'name' => 'ssba_bar_additional_css',
|
1181 |
+
'label' => 'Additional CSS',
|
1182 |
+
'tooltip' => 'Add your own additional CSS if you wish',
|
1183 |
+
'value' => isset( $arr_settings['ssba_bar_additional_css'] ) ? $arr_settings['ssba_bar_additional_css'] : '',
|
1184 |
+
);
|
1185 |
+
|
1186 |
+
// Enable custom css.
|
1187 |
+
$opts41 = array(
|
1188 |
+
'form_group' => false,
|
1189 |
+
'type' => 'checkbox',
|
1190 |
+
'name' => 'ssba_custom_styles_enabled',
|
1191 |
+
'label' => 'Enable Custom CSS',
|
1192 |
+
'tooltip' => 'Switch on to disable all SSBA styles and use your own custom CSS',
|
1193 |
+
'value' => 'Y',
|
1194 |
+
'checked' => isset( $arr_settings['ssba_custom_styles_enabled'] ) && 'Y' === $arr_settings['ssba_custom_styles_enabled'] ? 'checked' : null,
|
1195 |
+
);
|
1196 |
+
|
1197 |
+
// Custom css.
|
1198 |
+
$opts42 = array(
|
1199 |
+
'form_group' => false,
|
1200 |
+
'type' => 'textarea',
|
1201 |
+
'rows' => '15',
|
1202 |
+
'class' => 'code-font',
|
1203 |
+
'name' => 'ssba_custom_styles',
|
1204 |
+
'label' => 'Custom CSS',
|
1205 |
+
'tooltip' => 'Enter in your own custom CSS for your share buttons',
|
1206 |
+
'value' => isset( $arr_settings['ssba_custom_styles'] ) ? $arr_settings['ssba_custom_styles'] : '',
|
1207 |
+
);
|
1208 |
+
|
1209 |
+
// Switch to new buttons.
|
1210 |
+
$opts43 = array(
|
1211 |
+
'form_group' => false,
|
1212 |
+
'type' => 'checkbox',
|
1213 |
+
'name' => 'ssba_new_buttons',
|
1214 |
+
'label' => 'Plus Share Buttons',
|
1215 |
+
'tooltip' => 'If "On" new buttons replace the old on your site.',
|
1216 |
+
'value' => 'Y',
|
1217 |
+
'checked' => isset( $arr_settings['ssba_new_buttons'] ) && 'Y' === $arr_settings['ssba_new_buttons'] ? 'checked' : null,
|
1218 |
+
);
|
1219 |
+
|
1220 |
+
// Select style of new buttons.
|
1221 |
+
$opts44 = array(
|
1222 |
+
'form_group' => false,
|
1223 |
+
'type' => 'select',
|
1224 |
+
'name' => 'ssba_plus_button_style',
|
1225 |
+
'label' => 'Theme',
|
1226 |
+
'tooltip' => 'Choose the style of the new buttons',
|
1227 |
+
'selected' => isset( $arr_settings['ssba_plus_button_style'] ) ? $arr_settings['ssba_plus_button_style'] : '',
|
1228 |
+
'options' => array(
|
1229 |
+
'Round' => 1,
|
1230 |
+
'Square' => 2,
|
1231 |
+
'Logo Name' => 3,
|
1232 |
+
'Rounded' => 4,
|
1233 |
+
'3D' => 5,
|
1234 |
+
'Border Round' => 6,
|
1235 |
+
'Border Logo Name' => 7,
|
1236 |
+
'Black Border' => 8,
|
1237 |
+
'Underline' => 9,
|
1238 |
+
'Auto Square' => 10,
|
1239 |
+
'Name' => 11,
|
1240 |
+
),
|
1241 |
+
);
|
1242 |
+
|
1243 |
+
// Locations.
|
1244 |
+
$opts48 = array(
|
1245 |
+
'form_group' => false,
|
1246 |
+
'label' => 'Locations',
|
1247 |
+
'tooltip' => 'Enable the locations you wish for plus buttons to appear',
|
1248 |
+
'value' => 'Y',
|
1249 |
+
'checkboxes' => $locs3,
|
1250 |
+
);
|
1251 |
+
|
1252 |
+
// Placement.
|
1253 |
+
$opts49 = array(
|
1254 |
+
'form_group' => false,
|
1255 |
+
'type' => 'select',
|
1256 |
+
'name' => 'ssba_before_or_after_plus',
|
1257 |
+
'label' => 'Placement',
|
1258 |
+
'tooltip' => 'Place share buttons before or after your content',
|
1259 |
+
'selected' => isset( $arr_settings['ssba_before_or_after_plus'] ) ? $arr_settings['ssba_before_or_after_plus'] : '',
|
1260 |
+
'options' => array(
|
1261 |
+
'After' => 'after',
|
1262 |
+
'Before' => 'before',
|
1263 |
+
'Both' => 'both',
|
1264 |
+
),
|
1265 |
+
);
|
1266 |
+
|
1267 |
+
// Locations.
|
1268 |
+
$opts45 = array(
|
1269 |
+
'form_group' => false,
|
1270 |
+
'label' => 'Locations',
|
1271 |
+
'tooltip' => 'Enable the locations you wish for share buttons to appear',
|
1272 |
+
'value' => 'Y',
|
1273 |
+
'checkboxes' => $locs2,
|
1274 |
+
);
|
1275 |
+
|
1276 |
+
// Select style of share bar.
|
1277 |
+
$opts46 = array(
|
1278 |
+
'form_group' => false,
|
1279 |
+
'type' => 'select',
|
1280 |
+
'name' => 'ssba_bar_style',
|
1281 |
+
'label' => 'Style',
|
1282 |
+
'tooltip' => 'Choose the style of the share bar buttons',
|
1283 |
+
'selected' => isset( $arr_settings['ssba_bar_style'] ) ? $arr_settings['ssba_bar_style'] : '',
|
1284 |
+
'options' => array(
|
1285 |
+
'Round' => 1,
|
1286 |
+
'Square' => 2,
|
1287 |
+
'Rounded' => 4,
|
1288 |
+
'3D' => 5,
|
1289 |
+
'Border Round' => 6,
|
1290 |
+
'Black Border' => 8,
|
1291 |
+
'Underline' => 9,
|
1292 |
+
),
|
1293 |
+
);
|
1294 |
+
|
1295 |
+
// Select position of share bar.
|
1296 |
+
$opts47 = array(
|
1297 |
+
'form_group' => false,
|
1298 |
+
'type' => 'select',
|
1299 |
+
'name' => 'ssba_bar_position',
|
1300 |
+
'label' => 'Alignment',
|
1301 |
+
'tooltip' => 'Choose the share bar position',
|
1302 |
+
'selected' => isset( $arr_settings['ssba_bar_position'] ) ? $arr_settings['ssba_bar_position'] : '',
|
1303 |
+
'options' => array(
|
1304 |
+
'Sticky Left' => 'left',
|
1305 |
+
'Sticky Right' => 'right',
|
1306 |
+
),
|
1307 |
+
);
|
1308 |
+
|
1309 |
+
// Plus buttons height.
|
1310 |
+
$plus_height = array(
|
1311 |
+
'form_group' => false,
|
1312 |
+
'type' => 'number_addon',
|
1313 |
+
'addon' => 'px',
|
1314 |
+
'placeholder' => '48',
|
1315 |
+
'name' => 'ssba_plus_height',
|
1316 |
+
'label' => 'Height',
|
1317 |
+
'tooltip' => 'Set the height of the plus buttons',
|
1318 |
+
'value' => isset( $arr_settings['ssba_plus_height'] ) ? $arr_settings['ssba_plus_height'] : '',
|
1319 |
+
);
|
1320 |
+
|
1321 |
+
// Plus buttons width.
|
1322 |
+
$plus_width = array(
|
1323 |
+
'form_group' => false,
|
1324 |
+
'type' => 'number_addon',
|
1325 |
+
'addon' => 'px',
|
1326 |
+
'placeholder' => '48',
|
1327 |
+
'name' => 'ssba_plus_width',
|
1328 |
+
'label' => 'Width',
|
1329 |
+
'tooltip' => 'Set the width of the plus buttons',
|
1330 |
+
'value' => isset( $arr_settings['ssba_plus_width'] ) ? $arr_settings['ssba_plus_width'] : '',
|
1331 |
+
);
|
1332 |
+
|
1333 |
+
// Plus icon size.
|
1334 |
+
$plus_icon_size = array(
|
1335 |
+
'form_group' => false,
|
1336 |
+
'type' => 'number_addon',
|
1337 |
+
'addon' => 'px',
|
1338 |
+
'placeholder' => '24',
|
1339 |
+
'name' => 'ssba_plus_icon_size',
|
1340 |
+
'label' => 'Icon Size',
|
1341 |
+
'tooltip' => 'Set the icon size of the plus buttons',
|
1342 |
+
'value' => isset( $arr_settings['ssba_plus_icon_size'] ) ? $arr_settings['ssba_plus_icon_size'] : '',
|
1343 |
+
);
|
1344 |
+
|
1345 |
+
// Plus button margin.
|
1346 |
+
$plus_margin = array(
|
1347 |
+
'form_group' => false,
|
1348 |
+
'type' => 'number_addon',
|
1349 |
+
'addon' => 'px',
|
1350 |
+
'placeholder' => '12',
|
1351 |
+
'name' => 'ssba_plus_margin',
|
1352 |
+
'label' => 'Margin',
|
1353 |
+
'tooltip' => 'Set the margin of the plus buttons',
|
1354 |
+
'value' => isset( $arr_settings['ssba_plus_margin'] ) ? $arr_settings['ssba_plus_margin'] : '',
|
1355 |
+
);
|
1356 |
+
|
1357 |
+
// Plus button color override.
|
1358 |
+
$plus_button_color = array(
|
1359 |
+
'form_group' => false,
|
1360 |
+
'type' => 'colorpicker',
|
1361 |
+
'name' => 'ssba_plus_button_color',
|
1362 |
+
'label' => 'Button Color',
|
1363 |
+
'tooltip' => 'Choose the color for all plus buttons',
|
1364 |
+
'value' => isset( $arr_settings['ssba_plus_button_color'] ) ? $arr_settings['ssba_plus_button_color'] : '',
|
1365 |
+
);
|
1366 |
+
|
1367 |
+
// Plus button hover color override.
|
1368 |
+
$plus_hover_color = array(
|
1369 |
+
'form_group' => false,
|
1370 |
+
'type' => 'colorpicker',
|
1371 |
+
'name' => 'ssba_plus_button_hover_color',
|
1372 |
+
'label' => 'Hover Color',
|
1373 |
+
'tooltip' => 'Choose the color for all plus buttons hover',
|
1374 |
+
'value' => isset( $arr_settings['ssba_plus_button_hover_color'] ) ? $arr_settings['ssba_plus_button_hover_color'] : '',
|
1375 |
+
);
|
1376 |
+
|
1377 |
+
// Plus icon color override.
|
1378 |
+
$plus_icon_color = array(
|
1379 |
+
'form_group' => false,
|
1380 |
+
'type' => 'colorpicker',
|
1381 |
+
'name' => 'ssba_plus_icon_color',
|
1382 |
+
'label' => 'Icon Color',
|
1383 |
+
'tooltip' => 'Choose the color for all plus button icons',
|
1384 |
+
'value' => isset( $arr_settings['ssba_plus_icon_color'] ) ? $arr_settings['ssba_plus_icon_color'] : '',
|
1385 |
+
);
|
1386 |
+
|
1387 |
+
// Plus button color override.
|
1388 |
+
$plus_icon_hover_color = array(
|
1389 |
+
'form_group' => false,
|
1390 |
+
'type' => 'colorpicker',
|
1391 |
+
'name' => 'ssba_plus_icon_hover_color',
|
1392 |
+
'label' => 'Icon Hover Color',
|
1393 |
+
'tooltip' => 'Choose the color for all plus button icons hover',
|
1394 |
+
'value' => isset( $arr_settings['ssba_plus_icon_hover_color'] ) ? $arr_settings['ssba_plus_icon_hover_color'] : '',
|
1395 |
+
);
|
1396 |
+
|
1397 |
+
// share buttons height.
|
1398 |
+
$share_height = array(
|
1399 |
+
'form_group' => false,
|
1400 |
+
'type' => 'number_addon',
|
1401 |
+
'addon' => 'px',
|
1402 |
+
'placeholder' => '48',
|
1403 |
+
'name' => 'ssba_bar_height',
|
1404 |
+
'label' => 'Height',
|
1405 |
+
'tooltip' => 'Set the height of the share bar buttons',
|
1406 |
+
'value' => isset( $arr_settings['ssba_bar_height'] ) ? $arr_settings['ssba_bar_height'] : '',
|
1407 |
+
);
|
1408 |
+
|
1409 |
+
// share buttons width.
|
1410 |
+
$share_width = array(
|
1411 |
+
'form_group' => false,
|
1412 |
+
'type' => 'number_addon',
|
1413 |
+
'addon' => 'px',
|
1414 |
+
'placeholder' => '48',
|
1415 |
+
'name' => 'ssba_bar_width',
|
1416 |
+
'label' => 'Width',
|
1417 |
+
'tooltip' => 'Set the width of the share bar buttons',
|
1418 |
+
'value' => isset( $arr_settings['ssba_bar_width'] ) ? $arr_settings['ssba_bar_width'] : '',
|
1419 |
+
);
|
1420 |
+
|
1421 |
+
// share icon size.
|
1422 |
+
$share_icon_size = array(
|
1423 |
+
'form_group' => false,
|
1424 |
+
'type' => 'number_addon',
|
1425 |
+
'addon' => 'px',
|
1426 |
+
'placeholder' => '24',
|
1427 |
+
'name' => 'ssba_bar_icon_size',
|
1428 |
+
'label' => 'Icon Size',
|
1429 |
+
'tooltip' => 'Set the icon size of the share bar buttons',
|
1430 |
+
'value' => isset( $arr_settings['ssba_bar_icon_size'] ) ? $arr_settings['ssba_bar_icon_size'] : '',
|
1431 |
+
);
|
1432 |
+
|
1433 |
+
// share button margin.
|
1434 |
+
$share_margin = array(
|
1435 |
+
'form_group' => false,
|
1436 |
+
'type' => 'number_addon',
|
1437 |
+
'addon' => 'px',
|
1438 |
+
'placeholder' => '12',
|
1439 |
+
'name' => 'ssba_bar_margin',
|
1440 |
+
'label' => 'Margin',
|
1441 |
+
'tooltip' => 'Set the margin of the share bar buttons',
|
1442 |
+
'value' => isset( $arr_settings['ssba_bar_margin'] ) ? $arr_settings['ssba_bar_margin'] : '',
|
1443 |
+
);
|
1444 |
+
|
1445 |
+
// share button color override.
|
1446 |
+
$share_button_color = array(
|
1447 |
+
'form_group' => false,
|
1448 |
+
'type' => 'colorpicker',
|
1449 |
+
'name' => 'ssba_bar_button_color',
|
1450 |
+
'label' => 'Button Color',
|
1451 |
+
'tooltip' => 'Choose the color for all share bar buttons',
|
1452 |
+
'value' => isset( $arr_settings['ssba_bar_button_color'] ) ? $arr_settings['ssba_bar_button_color'] : '',
|
1453 |
+
);
|
1454 |
+
|
1455 |
+
// share button hover color override.
|
1456 |
+
$share_hover_color = array(
|
1457 |
+
'form_group' => false,
|
1458 |
+
'type' => 'colorpicker',
|
1459 |
+
'name' => 'ssba_bar_button_hover_color',
|
1460 |
+
'label' => 'Hover Color',
|
1461 |
+
'tooltip' => 'Choose the color for all share bar buttons hover',
|
1462 |
+
'value' => isset( $arr_settings['ssba_bar_button_hover_color'] ) ? $arr_settings['ssba_bar_button_hover_color'] : '',
|
1463 |
+
);
|
1464 |
+
|
1465 |
+
// share icon color override.
|
1466 |
+
$share_icon_color = array(
|
1467 |
+
'form_group' => false,
|
1468 |
+
'type' => 'colorpicker',
|
1469 |
+
'name' => 'ssba_bar_icon_color',
|
1470 |
+
'label' => 'Icon Color',
|
1471 |
+
'tooltip' => 'Choose the color for all share bar button icons',
|
1472 |
+
'value' => isset( $arr_settings['ssba_bar_icon_color'] ) ? $arr_settings['ssba_bar_icon_color'] : '',
|
1473 |
+
);
|
1474 |
+
|
1475 |
+
// share button color override.
|
1476 |
+
$share_icon_hover_color = array(
|
1477 |
+
'form_group' => false,
|
1478 |
+
'type' => 'colorpicker',
|
1479 |
+
'name' => 'ssba_bar_icon_hover_color',
|
1480 |
+
'label' => 'Icon Hover Color',
|
1481 |
+
'tooltip' => 'Choose the color for all share bar button icons hover',
|
1482 |
+
'value' => isset( $arr_settings['ssba_bar_icon_hover_color'] ) ? $arr_settings['ssba_bar_icon_hover_color'] : '',
|
1483 |
+
);
|
1484 |
+
|
1485 |
+
// Enable share bar.
|
1486 |
+
$share_bar = array(
|
1487 |
+
'form_group' => false,
|
1488 |
+
'type' => 'checkbox',
|
1489 |
+
'name' => 'ssba_bar_enabled',
|
1490 |
+
'label' => 'Share Bar',
|
1491 |
+
'tooltip' => 'If "On" share bar will appear on your site.',
|
1492 |
+
'value' => 'Y',
|
1493 |
+
'checked' => isset( $arr_settings['ssba_bar_enabled'] ) && 'Y' === $arr_settings['ssba_bar_enabled'] ? 'checked' : null,
|
1494 |
+
);
|
1495 |
+
|
1496 |
+
// Share bar display.
|
1497 |
+
$share_bar_display = array(
|
1498 |
+
'form_group' => false,
|
1499 |
+
'label' => 'Display on',
|
1500 |
+
'tooltip' => 'Disable to hide on desktop or mobile views',
|
1501 |
+
'value' => 'Y',
|
1502 |
+
'checkboxes' => $display_loc,
|
1503 |
+
);
|
1504 |
+
|
1505 |
+
// share button mobile breakpoint.
|
1506 |
+
$mobile_breakpoint = array(
|
1507 |
+
'form_group' => false,
|
1508 |
+
'type' => 'number_addon',
|
1509 |
+
'addon' => 'px',
|
1510 |
+
'placeholder' => '780',
|
1511 |
+
'name' => 'ssba_mobile_breakpoint',
|
1512 |
+
'label' => 'Mobile Breakpoint',
|
1513 |
+
'tooltip' => 'Set the share bar mobile breakpoint when it centers on screen',
|
1514 |
+
'value' => isset( $arr_settings['ssba_mobile_breakpoint'] ) ? $arr_settings['ssba_mobile_breakpoint'] : '',
|
1515 |
+
);
|
1516 |
+
|
1517 |
+
// Sharedcount api key.
|
1518 |
+
$page_omit = array(
|
1519 |
+
'form_group' => false,
|
1520 |
+
'type' => 'text',
|
1521 |
+
'placeholder' => 'Enter page titles separated by commas...',
|
1522 |
+
'name' => 'ssba_omit_pages',
|
1523 |
+
'label' => 'Hide On These Pages',
|
1524 |
+
'tooltip' => 'Add one or more page titles separated by commas of pages you wish to hide these buttons on.',
|
1525 |
+
'value' => isset( $arr_settings['ssba_omit_pages'] ) ? $arr_settings['ssba_omit_pages'] : '',
|
1526 |
+
);
|
1527 |
+
|
1528 |
+
// Sharedcount api key.
|
1529 |
+
$page_omit_plus = array(
|
1530 |
+
'form_group' => false,
|
1531 |
+
'type' => 'text',
|
1532 |
+
'placeholder' => 'Enter page titles separated by commas...',
|
1533 |
+
'name' => 'ssba_omit_pages_plus',
|
1534 |
+
'label' => 'Hide On These Pages',
|
1535 |
+
'tooltip' => 'Add one or more page titles separated by commas of pages you wish to hide these buttons on.',
|
1536 |
+
'value' => isset( $arr_settings['ssba_omit_pages_plus'] ) ? $arr_settings['ssba_omit_pages_plus'] : '',
|
1537 |
+
);
|
1538 |
+
|
1539 |
+
// Sharedcount api key.
|
1540 |
+
$page_omit_bar = array(
|
1541 |
+
'form_group' => false,
|
1542 |
+
'type' => 'text',
|
1543 |
+
'placeholder' => 'Enter page titles separated by commas...',
|
1544 |
+
'name' => 'ssba_omit_pages_bar',
|
1545 |
+
'label' => 'Hide On These Pages',
|
1546 |
+
'tooltip' => 'Add one or more page titles separated by commas of pages you wish to hide these buttons on.',
|
1547 |
+
'value' => isset( $arr_settings['ssba_omit_pages_bar'] ) ? $arr_settings['ssba_omit_pages_bar'] : '',
|
1548 |
+
);
|
1549 |
+
|
1550 |
+
// Notices.
|
1551 |
+
$notice = get_option( 'ssba_dismiss_notice' );
|
1552 |
+
$buttons = get_option( 'ssba_buttons' );
|
1553 |
+
$buttons = ! empty( $buttons ) ? $buttons : array();
|
1554 |
+
|
1555 |
+
// All buttons.
|
1556 |
+
$arr_buttons = array_values( $buttons );
|
1557 |
+
$selected_buttons = explode( ',', $arr_settings['ssba_selected_buttons'] );
|
1558 |
+
$selected_plus_buttons = explode( ',', $arr_settings['ssba_selected_plus_buttons'] );
|
1559 |
+
$selected_bar_buttons = explode( ',', $arr_settings['ssba_selected_bar_buttons'] );
|
1560 |
+
$non_selected_buttons = array();
|
1561 |
+
|
1562 |
+
// Empty beginnings.
|
1563 |
+
$selected_button_array = array();
|
1564 |
+
$selected_bar_button_array = array();
|
1565 |
+
$selected_plus_button_array = array();
|
1566 |
+
$non_plus_selected_buttons = array();
|
1567 |
+
$non_bar_selected_buttons = array();
|
1568 |
+
|
1569 |
+
// Custom button key.
|
1570 |
+
$custom_buttons = $this->get_custom_button_key( $arr_settings );
|
1571 |
+
|
1572 |
+
foreach ( $arr_buttons as $button_name ) {
|
1573 |
+
$new_name = str_replace(
|
1574 |
+
'+',
|
1575 |
+
'',
|
1576 |
+
str_replace( ' ', '_', strtolower( $button_name['full_name'] ) )
|
1577 |
+
);
|
1578 |
+
$new_arr_buttons[ $new_name ] = $button_name;
|
1579 |
+
}
|
1580 |
+
|
1581 |
+
foreach ( $selected_buttons as $button ) {
|
1582 |
+
if ( isset( $new_arr_buttons[ $button ] ) ) {
|
1583 |
+
$selected_button_array[] = $new_arr_buttons[ $button ];
|
1584 |
+
}
|
1585 |
+
}
|
1586 |
+
|
1587 |
+
// Plus buttons.
|
1588 |
+
foreach ( $selected_plus_buttons as $plus_button ) {
|
1589 |
+
if ( isset( $new_arr_buttons[ $plus_button ] ) ) {
|
1590 |
+
$selected_plus_button_array[] = $new_arr_buttons[ $plus_button ];
|
1591 |
+
}
|
1592 |
+
}
|
1593 |
+
|
1594 |
+
// Bar buttons.
|
1595 |
+
foreach ( $selected_bar_buttons as $bar_button ) {
|
1596 |
+
if ( isset( $new_arr_buttons[ $bar_button ] ) ) {
|
1597 |
+
$selected_bar_button_array[] = $new_arr_buttons[ $bar_button ];
|
1598 |
+
}
|
1599 |
+
}
|
1600 |
+
|
1601 |
+
foreach ( $arr_buttons as $non_buttons ) {
|
1602 |
+
if ( true === isset( $selected_button_array )
|
1603 |
+
&& true === is_array( $selected_button_array )
|
1604 |
+
&& false === in_array( $non_buttons, $selected_button_array, true ) ) {
|
1605 |
+
$non_selected_buttons[] = $non_buttons;
|
1606 |
+
}
|
1607 |
+
}
|
1608 |
+
|
1609 |
+
// Plus buttons.
|
1610 |
+
foreach ( $arr_buttons as $non_plus_buttons ) {
|
1611 |
+
if (
|
1612 |
+
true === isset( $selected_plus_button_array )
|
1613 |
+
&& true === is_array( $selected_plus_button_array )
|
1614 |
+
&& false === in_array( $non_plus_buttons, $selected_plus_button_array, true )
|
1615 |
+
) {
|
1616 |
+
$non_plus_selected_buttons[] = $non_plus_buttons;
|
1617 |
+
}
|
1618 |
+
}
|
1619 |
+
|
1620 |
+
// Bar Buttons.
|
1621 |
+
foreach ( $arr_buttons as $non_bar_buttons ) {
|
1622 |
+
if ( true === isset( $selected_bar_button_array )
|
1623 |
+
&& true === is_array( $selected_bar_button_array )
|
1624 |
+
&& false === in_array(
|
1625 |
+
$non_bar_buttons,
|
1626 |
+
$selected_bar_button_array,
|
1627 |
+
true
|
1628 |
+
) ) {
|
1629 |
+
$non_bar_selected_buttons[] = $non_bar_buttons;
|
1630 |
+
}
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
if ( true === isset( $selected_button_array )
|
1634 |
+
&& false === is_array( $selected_button_array )
|
1635 |
+
&& true === is_array( $non_selected_buttons )
|
1636 |
+
) {
|
1637 |
+
$arr_buttons = $non_selected_buttons;
|
1638 |
+
} elseif ( ! is_array( $non_selected_buttons ) && is_array( $selected_button_array ) ) {
|
1639 |
+
$arr_buttons = $selected_button_array;
|
1640 |
+
} elseif ( is_array( $selected_button_array ) && is_array( $non_selected_buttons ) ) {
|
1641 |
+
$arr_buttons = array_merge( $selected_button_array, $non_selected_buttons );
|
1642 |
+
}
|
1643 |
+
|
1644 |
+
// Plus buttons.
|
1645 |
+
if ( true === isset( $selected_plus_button_array )
|
1646 |
+
&& false === is_array( $selected_plus_button_array )
|
1647 |
+
&& true === is_array( $non_plus_selected_buttons )
|
1648 |
+
) {
|
1649 |
+
$arr_plus_buttons = $non_plus_selected_buttons;
|
1650 |
+
} elseif ( ! is_array( $non_plus_selected_buttons ) && is_array( $selected_plus_button_array ) ) {
|
1651 |
+
$arr_plus_buttons = $selected_plus_button_array;
|
1652 |
+
} elseif ( is_array( $selected_plus_button_array ) && is_array( $non_plus_selected_buttons ) ) {
|
1653 |
+
$arr_plus_buttons = array_merge( $selected_plus_button_array, $non_plus_selected_buttons );
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
// Bar buttons.
|
1657 |
+
if ( true === isset( $selected_bar_button_array )
|
1658 |
+
&& false === is_array( $selected_bar_button_array )
|
1659 |
+
&& true === is_array( $non_bar_selected_buttons )
|
1660 |
+
) {
|
1661 |
+
$arr_bar_buttons = $non_bar_selected_buttons;
|
1662 |
+
} elseif ( ! is_array( $non_bar_selected_buttons ) && is_array( $selected_bar_button_array ) ) {
|
1663 |
+
$arr_bar_buttons = $selected_bar_button_array;
|
1664 |
+
} elseif ( is_array( $selected_bar_button_array ) && is_array( $non_bar_selected_buttons ) ) {
|
1665 |
+
$arr_bar_buttons = array_merge( $selected_bar_button_array, $non_bar_selected_buttons );
|
1666 |
+
}
|
1667 |
+
|
1668 |
+
// GDPR vendors.
|
1669 |
+
$vendor_data = $this->get_gdpr_vendors();
|
1670 |
+
$vendors = isset( $vendor_data['vendors'] ) ? $vendor_data['vendors'] : array();
|
1671 |
+
$purposes = isset( $vendor_data['purposes'] ) && is_array( $vendor_data['purposes'] ) ? array_column( $vendor_data['purposes'], 'name', 'id' ) : array();
|
1672 |
+
|
1673 |
+
include_once "{$this->plugin->dir_path}/templates/admin-panel.php";
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
/**
|
1677 |
+
* Helper function to get gdpr vendors.
|
1678 |
+
*/
|
1679 |
+
private function get_gdpr_vendors() {
|
1680 |
+
$response = wp_remote_get( 'https://vendorlist.consensu.org/v2/vendor-list.json' );
|
1681 |
+
|
1682 |
+
return json_decode( wp_remote_retrieve_body( $response ), true );
|
1683 |
+
}
|
1684 |
+
|
1685 |
+
/**
|
1686 |
+
* Get an html formatted of currently selected and ordered buttons.
|
1687 |
+
*
|
1688 |
+
* @param array $str_selected_ssba The selected buttons.
|
1689 |
+
* @param array $arr_settings The current ssba settings.
|
1690 |
+
*
|
1691 |
+
* @return string
|
1692 |
+
*/
|
1693 |
+
public function get_selected_ssba( $str_selected_ssba, $arr_settings ) {
|
1694 |
+
// Variables.
|
1695 |
+
$html_selected_list = '';
|
1696 |
+
|
1697 |
+
// Prepare array of buttons.
|
1698 |
+
$arr_buttons = get_option( 'ssba_buttons', true );
|
1699 |
+
|
1700 |
+
// If there are some selected buttons.
|
1701 |
+
if ( '' !== $str_selected_ssba && null !== $str_selected_ssba && false !== $str_selected_ssba ) {
|
1702 |
+
// Explode saved include list and add to a new array.
|
1703 |
+
$arr_selected_ssba = explode( ',', $str_selected_ssba );
|
1704 |
+
|
1705 |
+
// Check if array is not empty.
|
1706 |
+
if ( '' !== $arr_selected_ssba ) {
|
1707 |
+
// For each included button.
|
1708 |
+
foreach ( $arr_selected_ssba as $str_selected ) {
|
1709 |
+
// If share this terms haven't been accepted and it's the
|
1710 |
+
// facebook save button then make the button look disabled.
|
1711 |
+
$disabled = 'Y' !== $arr_settings['accepted_sharethis_terms'] && 'facebook_save' === $str_selected ? 'style="background-color:#eaeaea;"' : null;
|
1712 |
+
$button_full_name = isset( $arr_buttons[ $str_selected ]['full_name'] ) ? $arr_buttons[ $str_selected ]['full_name'] : '';
|
1713 |
+
|
1714 |
+
// Add a list item for each selected option.
|
1715 |
+
$html_selected_list .= '<li class="ssbp-option-item" id="' . esc_attr( $str_selected ) . '"><a title="' . esc_attr( $button_full_name ) . '" class="ssbp-btn ssbp-' . esc_attr( $str_selected ) . '" ' . esc_attr( $disabled ) . '></a></li>';
|
1716 |
+
}
|
1717 |
+
}
|
1718 |
+
}
|
1719 |
+
|
1720 |
+
// Return html list options.
|
1721 |
+
return $html_selected_list;
|
1722 |
+
}
|
1723 |
+
|
1724 |
+
/**
|
1725 |
+
* Custom button key.
|
1726 |
+
*
|
1727 |
+
* @param array $arr_settings The current site settings.
|
1728 |
+
*/
|
1729 |
+
public function get_custom_button_key( $arr_settings ) {
|
1730 |
+
$custom_array = array(
|
1731 |
+
'facebook' => isset( $arr_settings['ssba_custom_facebook'] ) ? $arr_settings['ssba_custom_facebook'] : '',
|
1732 |
+
'twitter' => isset( $arr_settings['ssba_custom_twitter'] ) ? $arr_settings['ssba_custom_twitter'] : '',
|
1733 |
+
'linkedin' => isset( $arr_settings['ssba_custom_linkedin'] ) ? $arr_settings['ssba_custom_linkedin'] : '',
|
1734 |
+
'flattr' => isset( $arr_settings['ssba_custom_flattr'] ) ? $arr_settings['ssba_custom_flattr'] : '',
|
1735 |
+
'pinterest' => isset( $arr_settings['ssba_custom_pinterest'] ) ? $arr_settings['ssba_custom_pinterest'] : '',
|
1736 |
+
'print' => isset( $arr_settings['ssba_custom_print'] ) ? $arr_settings['ssba_custom_print'] : '',
|
1737 |
+
'reddit' => isset( $arr_settings['ssba_custom_reddit'] ) ? $arr_settings['ssba_custom_reddit'] : '',
|
1738 |
+
'stumbleupon' => isset( $arr_settings['ssba_custom_stumbleupon'] ) ? $arr_settings['ssba_custom_stumbleupon'] : '',
|
1739 |
+
'tumblr' => isset( $arr_settings['ssba_custom_tumblr'] ) ? $arr_settings['ssba_custom_tumblr'] : '',
|
1740 |
+
'vk' => isset( $arr_settings['ssba_custom_vk'] ) ? $arr_settings['ssba_custom_vk'] : '',
|
1741 |
+
'whatsapp' => isset( $arr_settings['ssba_custom_whatsapp'] ) ? $arr_settings['ssba_custom_whatsapp'] : '',
|
1742 |
+
'xing' => isset( $arr_settings['ssba_custom_xing'] ) ? $arr_settings['ssba_custom_xing'] : '',
|
1743 |
+
'yummly' => isset( $arr_settings['ssba_custom_yummly'] ) ? $arr_settings['ssba_custom_yummly'] : '',
|
1744 |
+
);
|
1745 |
+
|
1746 |
+
return $custom_array;
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
/**
|
1750 |
+
* Get available share buttons.
|
1751 |
+
*
|
1752 |
+
* @param array $str_selected_ssba The selected buttons.
|
1753 |
+
* @param array $arr_settings The current ssba settings.
|
1754 |
+
* @param string $page Page string.
|
1755 |
+
*
|
1756 |
+
* @return string
|
1757 |
+
*/
|
1758 |
+
public function get_available_ssba( $str_selected_ssba, $arr_settings, $page = '' ) {
|
1759 |
+
// Variables.
|
1760 |
+
$html_available_list = '';
|
1761 |
+
|
1762 |
+
// Prepare array of buttons.
|
1763 |
+
$arr_buttons = get_option( 'ssba_buttons', true );
|
1764 |
+
$arr_buttons = false === empty( $arr_buttons ) && true === is_array( $arr_buttons ) ? $arr_buttons : array();
|
1765 |
+
|
1766 |
+
// Explode saved include list and add to a new array.
|
1767 |
+
$arr_selected_ssba = explode( ',', $str_selected_ssba );
|
1768 |
+
|
1769 |
+
// Extract the available buttons.
|
1770 |
+
$arr_available_ssba = array_diff( array_keys( $arr_buttons ), $arr_selected_ssba );
|
1771 |
+
|
1772 |
+
// Check if array is not empty.
|
1773 |
+
if ( false === empty( $arr_selected_ssba ) ) {
|
1774 |
+
// For each included button.
|
1775 |
+
foreach ( $arr_available_ssba as $str_available ) {
|
1776 |
+
// If share this terms haven't been accepted and it's the facebook save button then make the button look disabled.
|
1777 |
+
$disabled = 'Y' !== $arr_settings['accepted_sharethis_terms'] && 'facebook_save' === $str_available ? 'style="background-color:#eaeaea;"' : null;
|
1778 |
+
if ( 'facebook_save' === $str_available && true === isset( $arr_settings['bar_call'] ) ) {
|
1779 |
+
$html_available_list .= ''; // Do nothing.
|
1780 |
+
} else {
|
1781 |
+
if ( self::show_in_classic( $page, $arr_buttons[ $str_available ]['full_name'] ) ) {
|
1782 |
+
// Add a list item for each available option.
|
1783 |
+
$html_available_list .= '<li class="ssbp-option-item" id="' . esc_attr( $str_available ) . '"><a title="' . esc_attr( $arr_buttons[ $str_available ]['full_name'] ) . '" class="ssbp-btn ssbp-' . esc_attr( $str_available ) . '" ' . esc_attr( $disabled ) . '></a></li>';
|
1784 |
+
}
|
1785 |
+
}
|
1786 |
+
}
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
// Return html list options.
|
1790 |
+
return $html_available_list;
|
1791 |
+
}
|
1792 |
+
|
1793 |
+
/**
|
1794 |
+
* Show in classic button list or not.
|
1795 |
+
*
|
1796 |
+
* @param string $page Page.
|
1797 |
+
* @param string $button_name Button name.
|
1798 |
+
*
|
1799 |
+
* @return bool Show in classic?
|
1800 |
+
*/
|
1801 |
+
public static function show_in_classic( $page, $button_name ) {
|
1802 |
+
if ( 'classic' !== $page ) {
|
1803 |
+
return true;
|
1804 |
+
}
|
1805 |
+
|
1806 |
+
if (
|
1807 |
+
false === in_array(
|
1808 |
+
$button_name,
|
1809 |
+
array( 'Line', 'Skype', 'Snapchat', 'Telegram', 'Weibo' ),
|
1810 |
+
true
|
1811 |
+
)
|
1812 |
+
) {
|
1813 |
+
return true;
|
1814 |
+
}
|
1815 |
+
|
1816 |
+
return false;
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
/**
|
1820 |
+
* Get ssbp font family.
|
1821 |
+
*
|
1822 |
+
* @return string
|
1823 |
+
*/
|
1824 |
+
public function get_font_family() {
|
1825 |
+
return "@font-face {
|
1826 |
font-family: 'ssbp';
|
1827 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?xj3ol1');
|
1828 |
src:url('{$this->plugin->dir_url}fonts/ssbp.eot?#iefixxj3ol1') format('embedded-opentype'),
|
1836 |
-webkit-font-smoothing: antialiased;
|
1837 |
-moz-osx-font-smoothing: grayscale;
|
1838 |
}";
|
1839 |
+
}
|
1840 |
+
|
1841 |
+
/**
|
1842 |
+
* Register button widget.
|
1843 |
+
*
|
1844 |
+
* @action widgets_init
|
1845 |
+
*/
|
1846 |
+
public function register_widget() {
|
1847 |
+
register_widget( $this->widget_class );
|
1848 |
+
}
|
|
|
1849 |
}
|
php/class-buttons.php
CHANGED
@@ -12,2329 +12,2376 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Buttons
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
$html_share_buttons_form .= '.ssba-btn-save{ left: 0!important;
|
73 |
right: auto !important;
|
74 |
border-radius: 0 5px 5px 0; }';
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2340 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Buttons {
|
16 |
+
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Plugin instance.
|
20 |
+
*
|
21 |
+
* @var object
|
22 |
+
*/
|
23 |
+
public $plugin;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Simple Share Buttons Adder instance.
|
27 |
+
*
|
28 |
+
* @var object
|
29 |
+
*/
|
30 |
+
public $class_ssba;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Admin Panel Class.
|
34 |
+
*
|
35 |
+
* @var object
|
36 |
+
*/
|
37 |
+
public $admin_panel;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Class constructor.
|
41 |
+
*
|
42 |
+
* @param object $plugin Plugin class.
|
43 |
+
* @param object $class_ssba Simple Share Buttons Adder class.
|
44 |
+
* @param object $admin_panel Admin panel.
|
45 |
+
*/
|
46 |
+
public function __construct( $plugin, $class_ssba, $admin_panel ) {
|
47 |
+
$this->plugin = $plugin;
|
48 |
+
$this->class_ssba = $class_ssba;
|
49 |
+
$this->admin_panel = $admin_panel;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Enqueue font awesome.
|
54 |
+
*
|
55 |
+
* @action wp_enqueue_scripts
|
56 |
+
*/
|
57 |
+
public function font_awesome() {
|
58 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-font-awesome" );
|
59 |
+
|
60 |
+
$html_share_buttons_form = '';
|
61 |
+
|
62 |
+
// Get settings.
|
63 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
64 |
+
|
65 |
+
// Get the font family needed.
|
66 |
+
$html_share_buttons_form .= $this->admin_panel->get_font_family();
|
67 |
+
|
68 |
+
// If left to right.
|
69 |
+
if ( is_rtl() ) {
|
70 |
+
// Move save button.
|
71 |
+
$html_share_buttons_form .= '.ssba-btn-save{ left: 0!important;
|
|
|
72 |
right: auto !important;
|
73 |
border-radius: 0 5px 5px 0; }';
|
74 |
+
}
|
75 |
+
|
76 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_share_buttons_form );
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Format the returned number.
|
81 |
+
*
|
82 |
+
* @param integer $int_number The number to format.
|
83 |
+
*
|
84 |
+
* @return string
|
85 |
+
*/
|
86 |
+
public function ssba_format_number( $int_number ) {
|
87 |
+
// If the number is greater than or equal to 1000.
|
88 |
+
if ( $int_number >= 1000 ) {
|
89 |
+
// Divide by 1000 and add k.
|
90 |
+
$int_number = round( ( $int_number / 1000 ), 1 ) . 'k';
|
91 |
+
}
|
92 |
+
|
93 |
+
// Return the number.
|
94 |
+
return $int_number;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Adds a filter around the content.
|
99 |
+
*
|
100 |
+
* @action wp_head, 99
|
101 |
+
*/
|
102 |
+
public function ssba_add_button_filter() {
|
103 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
104 |
+
|
105 |
+
add_filter( 'the_content', array( $this, 'show_share_buttons' ), (int) $arr_settings['ssba_content_priority'] );
|
106 |
+
|
107 |
+
// If we wish to add to excerpts.
|
108 |
+
if ( isset( $arr_settings['ssba_excerpts'] ) && 'Y' !== $arr_settings['ssba_excerpts'] ) {
|
109 |
+
add_filter( 'the_excerpt', array( $this, 'show_share_buttons' ) );
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Call back for showing share buttons.
|
115 |
+
*
|
116 |
+
* @param string $content The current page or post content.
|
117 |
+
* @param bool $boo_shortcode Whether to use shortcode or not.
|
118 |
+
* @param array $atts Manual replacements for page url/title.
|
119 |
+
*
|
120 |
+
* @return string
|
121 |
+
*/
|
122 |
+
public function show_share_buttons( $content, $boo_shortcode = false, $atts = '' ) {
|
123 |
+
global $post;
|
124 |
+
|
125 |
+
// Variables.
|
126 |
+
$html_content = $content;
|
127 |
+
$str_share_text = '';
|
128 |
+
$pattern = get_shortcode_regex();
|
129 |
+
|
130 |
+
// Ssba_hide shortcode is in the post content and instance is not called by shortcode ssba.
|
131 |
+
if ( isset( $post->post_content )
|
132 |
+
&&
|
133 |
+
preg_match_all( '/' . $pattern . '/s', $post->post_content, $matches )
|
134 |
+
&&
|
135 |
+
array_key_exists( 2, $matches )
|
136 |
+
&&
|
137 |
+
in_array( 'ssba_hide', $matches[2], true )
|
138 |
+
&&
|
139 |
+
! $boo_shortcode
|
140 |
+
) {
|
141 |
+
// Exit the function returning the content without the buttons.
|
142 |
+
return $content;
|
143 |
+
}
|
144 |
+
|
145 |
+
// Get sbba settings.
|
146 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
147 |
+
|
148 |
+
$page_title = $post->post_title;
|
149 |
+
$plus_omit_pages = ! empty( $arr_settings['ssba_omit_pages_plus'] ) ? explode( ',', $arr_settings['ssba_omit_pages_plus'] ) : '';
|
150 |
+
$plus_omitted = is_array( $plus_omit_pages ) ? in_array( $page_title, array_map( 'trim', $plus_omit_pages ), true ) : false;
|
151 |
+
$omit_pages = ! empty( $arr_settings['ssba_omit_pages'] ) ? explode( ',', $arr_settings['ssba_omit_pages'] ) : '';
|
152 |
+
$omitted = is_array( $omit_pages ) ? in_array( $page_title, array_map( 'trim', $omit_pages ), true ) : false;
|
153 |
+
|
154 |
+
if ( ( 'Y' === $arr_settings['ssba_new_buttons'] && $plus_omitted ) || ( 'Y' !== $arr_settings['ssba_new_buttons'] && $omitted ) ) {
|
155 |
+
return $content;
|
156 |
+
}
|
157 |
+
|
158 |
+
// Placement on pages/posts/categories/archives/homepage.
|
159 |
+
if ( ( ! is_home() && ! is_front_page() && is_page() && ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_pages'] || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_plus_pages'] ) ) )
|
160 |
+
||
|
161 |
+
( is_single() && ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_posts'] || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_plus_posts'] ) ) )
|
162 |
+
||
|
163 |
+
( is_category() && ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_cats_archs'] || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_plus_cats_archs'] ) ) )
|
164 |
+
||
|
165 |
+
( is_archive() && ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_cats_archs'] || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_plus_cats_archs'] ) ) )
|
166 |
+
||
|
167 |
+
( ( is_home() || is_front_page() ) && ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_homepage'] || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' === $arr_settings['ssba_plus_homepage'] ) ) )
|
168 |
+
||
|
169 |
+
$boo_shortcode
|
170 |
+
) {
|
171 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-ssba" );
|
172 |
+
|
173 |
+
// If not shortcode.
|
174 |
+
if ( isset( $atts['widget'] ) && 'Y' === $atts['widget'] && '' === $arr_settings['ssba_widget_text'] ) { // Use widget share text.
|
175 |
+
$str_share_text = $arr_settings['ssba_widget_text'];
|
176 |
+
} else { // Use normal share text.
|
177 |
+
$str_share_text = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['ssba_share_text'] : $arr_settings['ssba_plus_share_text'];
|
178 |
+
}
|
179 |
+
|
180 |
+
// Text placement.
|
181 |
+
$text_placement = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['ssba_text_placement'] : $arr_settings['ssba_plus_text_placement'];
|
182 |
+
|
183 |
+
// Link or no.
|
184 |
+
$text_link = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['ssba_link_to_ssb'] : $arr_settings['ssba_plus_link_to_ssb'];
|
185 |
+
|
186 |
+
// Post id.
|
187 |
+
$int_post_id = $post->ID;
|
188 |
+
|
189 |
+
// Button Position.
|
190 |
+
$button_position = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['ssba_before_or_after'] : $arr_settings['ssba_before_or_after_plus'];
|
191 |
+
|
192 |
+
// Button alignment.
|
193 |
+
$alignment = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['ssba_align'] : $arr_settings['ssba_plus_align'];
|
194 |
+
|
195 |
+
// Wrap id.
|
196 |
+
$wrap_id = 'Y' !== $arr_settings['ssba_new_buttons'] ? 'ssba-classic-2' : 'ssba-modern-2';
|
197 |
+
|
198 |
+
// Ssba div.
|
199 |
+
$html_share_buttons = '<!-- Simple Share Buttons Adder (' . esc_html( SSBA_VERSION ) . ') simplesharebuttons.com --><div class="' . esc_attr( $wrap_id ) . ' ssba ssbp-wrap' . esc_attr( ' ' . $arr_settings['ssba_plus_align'] ) . ' ssbp--theme-' . esc_attr( $arr_settings['ssba_plus_button_style'] ) . '">';
|
200 |
+
|
201 |
+
// Center if set so.
|
202 |
+
$html_share_buttons .= '<div style="text-align:' . esc_attr( $alignment ) . '">';
|
203 |
+
|
204 |
+
// Add custom text if set and set to placement above or left.
|
205 |
+
if ( '' !== $str_share_text && ( 'above' === $text_placement || 'left' === $text_placement ) ) {
|
206 |
+
// Check if user has left share link box checked.
|
207 |
+
if ( 'Y' === $text_link ) {
|
208 |
+
// Share text with link.
|
209 |
+
$html_share_buttons .= '<a href="https://simplesharebuttons.com" target="_blank" class="ssba-share-text">' . esc_html( $str_share_text ) . '</a>';
|
210 |
+
} else {
|
211 |
+
// Share text.
|
212 |
+
$html_share_buttons .= '<span class="ssba-share-text">' . esc_html( $str_share_text ) . '</span>';
|
213 |
+
}
|
214 |
+
// Add a line break if set to above.
|
215 |
+
$html_share_buttons .= 'above' === $text_placement ? '<br/>' : '';
|
216 |
+
}
|
217 |
+
|
218 |
+
// If running standard.
|
219 |
+
if ( ! $boo_shortcode ) {
|
220 |
+
// Use WordPress functions for page/post details.
|
221 |
+
$url_current_page = get_permalink( $post->ID );
|
222 |
+
$str_page_title = get_the_title( $post->ID );
|
223 |
+
} else { // Using shortcode.
|
224 |
+
// Set page URL and title as set by user or get if needed.
|
225 |
+
$url_current_page = isset( $atts['url'] ) ? esc_url( $atts['url'] ) : $this->ssba_current_url( $atts );
|
226 |
+
$str_page_title = ( isset( $atts['title'] ) ? $atts['title'] : get_the_title() );
|
227 |
+
}
|
228 |
+
|
229 |
+
// Strip any unwanted tags from the page title.
|
230 |
+
$str_page_title = esc_attr( wp_strip_all_tags( $str_page_title ) );
|
231 |
+
|
232 |
+
// The buttons.
|
233 |
+
$html_share_buttons .= $this->get_share_buttons( $arr_settings, $url_current_page, $str_page_title, $int_post_id );
|
234 |
+
|
235 |
+
// Add custom text if set and set to placement right or below.
|
236 |
+
if ( '' !== $str_share_text && ( 'right' === $text_placement || 'below' === $text_placement ) ) {
|
237 |
+
// Add a line break if set to above.
|
238 |
+
$html_share_buttons .= 'below' === $text_placement ? '<br/>' : '';
|
239 |
+
|
240 |
+
// Check if user has checked share link option.
|
241 |
+
if ( 'Y' === $text_link ) {
|
242 |
+
// Share text with link.
|
243 |
+
$html_share_buttons .= '<a href="https://simplesharebuttons.com" target="_blank" class="ssba-share-text">' . esc_html( $str_share_text ) . '</a>';
|
244 |
+
} else { // Just display the share text.
|
245 |
+
// Share text.
|
246 |
+
$html_share_buttons .= '<span class="ssba-share-text">' . esc_html( $str_share_text ) . '</span>';
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
// Close center if set.
|
251 |
+
$html_share_buttons .= '</div></div>';
|
252 |
+
|
253 |
+
// If not using shortcode.
|
254 |
+
if ( ! $boo_shortcode ) {
|
255 |
+
// Switch for placement of ssba.
|
256 |
+
switch ( $button_position ) {
|
257 |
+
case 'before': // Before the content.
|
258 |
+
$html_content = $html_share_buttons . $content;
|
259 |
+
break;
|
260 |
+
case 'after': // After the content.
|
261 |
+
$html_content = $content . $html_share_buttons;
|
262 |
+
break;
|
263 |
+
case 'both': // Before and after the content.
|
264 |
+
$html_content = $html_share_buttons . $content . $html_share_buttons;
|
265 |
+
break;
|
266 |
+
}
|
267 |
+
} else { // If using shortcode.
|
268 |
+
// Just return buttons.
|
269 |
+
$html_content = $html_share_buttons;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
// Return content and share buttons.
|
274 |
+
return $html_content;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Function that shows the share bar if enabled.
|
279 |
+
*
|
280 |
+
* @action wp_head, 99
|
281 |
+
*/
|
282 |
+
public function show_share_bar() {
|
283 |
+
global $post, $wp;
|
284 |
+
|
285 |
+
// Get sbba settings.
|
286 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
287 |
+
$page_title = isset( $post->post_title ) ? $post->post_title : '';
|
288 |
+
$omit_pages = ! empty( $arr_settings['ssba_omit_pages_bar'] ) ? explode(
|
289 |
+
',',
|
290 |
+
$arr_settings['ssba_omit_pages_bar']
|
291 |
+
) : '';
|
292 |
+
$omitted = is_array( $omit_pages ) ? in_array( $page_title, array_map( 'trim', $omit_pages ), true ) : false;
|
293 |
+
|
294 |
+
if ( ( 'Y' !== $arr_settings['ssba_bar_desktop'] && ! wp_is_mobile() ) || ( 'Y' !== $arr_settings['ssba_bar_mobile'] && wp_is_mobile() ) || 'Y' !== $arr_settings['ssba_bar_enabled'] || $omitted ) {
|
295 |
+
return;
|
296 |
+
}
|
297 |
+
|
298 |
+
// Get current url.
|
299 |
+
$url_current_page = home_url( add_query_arg( array(), $wp->request ) );
|
300 |
+
|
301 |
+
// Placement on pages/posts/categories/archives/homepage.
|
302 |
+
if (
|
303 |
+
( ! is_home() && ! is_front_page() && is_page() && isset( $arr_settings['ssba_bar_pages'] ) && 'Y' === $arr_settings['ssba_bar_pages'] )
|
304 |
+
||
|
305 |
+
( is_single() && isset( $arr_settings['ssba_bar_posts'] ) && 'Y' === $arr_settings['ssba_bar_posts'] )
|
306 |
+
||
|
307 |
+
( is_category() && isset( $arr_settings['ssba_bar_cats_archs'] ) && 'Y' === $arr_settings['ssba_bar_cats_archs'] )
|
308 |
+
||
|
309 |
+
( is_archive() && isset( $arr_settings['ssba_bar_cats_archs'] ) && 'Y' === $arr_settings['ssba_bar_cats_archs'] )
|
310 |
+
||
|
311 |
+
( ( is_home() || is_front_page() ) && isset( $arr_settings['ssba_bar_homepage'] ) && 'Y' === $arr_settings['ssba_bar_homepage'] )
|
312 |
+
) {
|
313 |
+
|
314 |
+
if ( ! wp_style_is( "{$this->plugin->assets_prefix}-ssba", 'enqueued' ) ) {
|
315 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-ssba" );
|
316 |
+
}
|
317 |
+
|
318 |
+
$html_share_buttons = '<div id="ssba-bar-2" class="' . esc_attr( $arr_settings['ssba_bar_position'] ) . ' ssbp-wrap ssbp--theme-' . esc_attr( $arr_settings['ssba_bar_style'] ) . '" >';
|
319 |
+
$html_share_buttons .= '<div class="ssbp-container">';
|
320 |
+
$html_share_buttons .= '<ul class="ssbp-bar-list">';
|
321 |
+
|
322 |
+
// The buttons.
|
323 |
+
$html_share_buttons .= $this->get_share_bar( $arr_settings, $url_current_page, $post->post_title, $post->ID );
|
324 |
+
$html_share_buttons .= '</div></ul>';
|
325 |
+
$html_share_buttons .= '</div>';
|
326 |
+
|
327 |
+
echo $html_share_buttons; // phpcs:ignore XSS ok. Pinterest contains javascript. Cannot sanitize output.
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Shortcode for adding buttons.
|
333 |
+
*
|
334 |
+
* @param array $atts The current shortcodes attributes.
|
335 |
+
*
|
336 |
+
* @shortcode ssba-buttons
|
337 |
+
*
|
338 |
+
* @return string
|
339 |
+
*/
|
340 |
+
public function ssba_buttons( $atts ) {
|
341 |
+
// Get buttons - NULL for $content, TRUE for shortcode flag.
|
342 |
+
$html_share_buttons = $this->show_share_buttons( null, true, $atts );
|
343 |
+
|
344 |
+
// Return buttons.
|
345 |
+
return $html_share_buttons;
|
346 |
+
}
|
347 |
+
|
348 |
+
/**
|
349 |
+
* Shortcode for adding buttons.
|
350 |
+
*
|
351 |
+
* @param array $atts The current shortcodes attributes.
|
352 |
+
*
|
353 |
+
* @shortcode ssba
|
354 |
+
*
|
355 |
+
* @return string
|
356 |
+
*/
|
357 |
+
public function ssba_orig_buttons( $atts ) {
|
358 |
+
// Get buttons - NULL for $content, TRUE for shortcode flag.
|
359 |
+
$html_share_buttons = $this->show_share_buttons( null, true, $atts );
|
360 |
+
|
361 |
+
// Return buttons.
|
362 |
+
return $html_share_buttons;
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Shortcode for hiding buttons
|
367 |
+
*
|
368 |
+
* @param string $content The current page or posts content.
|
369 |
+
*
|
370 |
+
* @shortcode ssba_hide
|
371 |
+
*/
|
372 |
+
public function ssba_hide( $content ) {
|
373 |
+
// No need to do anything here!
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Get URL function.
|
378 |
+
*
|
379 |
+
* @param array $atts The supplied attributes.
|
380 |
+
*
|
381 |
+
* @return string
|
382 |
+
*/
|
383 |
+
public function ssba_current_url( $atts ) {
|
384 |
+
global $post;
|
385 |
+
|
386 |
+
if ( ! isset( $_SERVER['SERVER_NAME'] ) || ! isset( $_SERVER['REQUEST_URI'] ) ) {
|
387 |
+
return;
|
388 |
+
}
|
389 |
+
|
390 |
+
// If multisite has been set to true.
|
391 |
+
if ( isset( $atts['multisite'] ) && isset( $_SERVER['QUERY_STRING'] ) ) {
|
392 |
+
global $wp;
|
393 |
+
|
394 |
+
$url = add_query_arg( sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ) ), '', home_url( $wp->request ) ); // WPCS: CSRF ok.
|
395 |
+
|
396 |
+
return esc_url( $url );
|
397 |
+
}
|
398 |
+
|
399 |
+
// Add http.
|
400 |
+
$url_current_page = 'http';
|
401 |
+
|
402 |
+
// Add s to http if required.
|
403 |
+
if ( isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ) {
|
404 |
+
$url_current_page .= 's';
|
405 |
+
}
|
406 |
+
|
407 |
+
// Add colon and forward slashes.
|
408 |
+
$url_current_page .= '://' . sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ) );
|
409 |
+
|
410 |
+
$url_current_page = '_' === $_SERVER['SERVER_NAME'] ? get_permalink( $post->ID ) : $url_current_page;
|
411 |
+
|
412 |
+
// Return url.
|
413 |
+
return esc_url( $url_current_page );
|
414 |
+
}
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Get set share buttons.
|
418 |
+
*
|
419 |
+
* @param array $arr_settings The current ssba settings.
|
420 |
+
* @param string $url_current_page The current pages url.
|
421 |
+
* @param string $str_page_title The page title.
|
422 |
+
* @param integer $int_post_id The post id.
|
423 |
+
*
|
424 |
+
* @return string
|
425 |
+
*/
|
426 |
+
public function get_share_buttons( $arr_settings, $url_current_page, $str_page_title, $int_post_id ) {
|
427 |
+
// Variables.
|
428 |
+
$html_share_buttons = '';
|
429 |
+
|
430 |
+
// Explode saved include list and add to a new array.
|
431 |
+
$arr_selected_ssba = 'Y' === $arr_settings['ssba_new_buttons'] ? explode( ',', $arr_settings['ssba_selected_plus_buttons'] ) : explode( ',', $arr_settings['ssba_selected_buttons'] );
|
432 |
+
|
433 |
+
// Check if array is not empty.
|
434 |
+
if ( is_array( $arr_selected_ssba ) && '' !== $arr_selected_ssba[0] ) {
|
435 |
+
// Add post ID to settings array.
|
436 |
+
$arr_settings['post_id'] = $int_post_id;
|
437 |
+
|
438 |
+
// If show counters option is selected.
|
439 |
+
if ( 'Y' === $arr_settings['ssba_show_share_count'] ) {
|
440 |
+
// Set show flag to true.
|
441 |
+
$boo_show_share_count = true;
|
442 |
+
|
443 |
+
// If show counters once option is selected.
|
444 |
+
if ( 'Y' === $arr_settings['ssba_share_count_once'] ) {
|
445 |
+
// If not a page or post.
|
446 |
+
if ( ! is_page() && ! is_single() ) {
|
447 |
+
// Let show flag to false.
|
448 |
+
$boo_show_share_count = false;
|
449 |
+
}
|
450 |
+
}
|
451 |
+
} else {
|
452 |
+
// Set show flag to false.
|
453 |
+
$boo_show_share_count = false;
|
454 |
+
}
|
455 |
+
|
456 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] ) {
|
457 |
+
$html_share_buttons .= '<ul class="ssbp-list">';
|
458 |
+
}
|
459 |
+
|
460 |
+
// For each included button.
|
461 |
+
foreach ( $arr_selected_ssba as $str_selected ) {
|
462 |
+
$str_get_button = 'ssba_' . $str_selected;
|
463 |
+
|
464 |
+
// Add a list item for each selected option.
|
465 |
+
$html_share_buttons .= $this->$str_get_button( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count );
|
466 |
+
}
|
467 |
+
|
468 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] ) {
|
469 |
+
$html_share_buttons .= '</ul>';
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
// Return share buttons.
|
474 |
+
return $html_share_buttons;
|
475 |
+
}
|
476 |
+
|
477 |
+
/**
|
478 |
+
* Get facebook button.
|
479 |
+
*
|
480 |
+
* @param array $arr_settings The current ssba settings.
|
481 |
+
* @param string $url_current_page The current page url.
|
482 |
+
* @param string $str_page_title The page title.
|
483 |
+
* @param bool $boo_show_share_count Show share count or not.
|
484 |
+
*
|
485 |
+
* @return string
|
486 |
+
*/
|
487 |
+
public function ssba_facebook( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
488 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
489 |
+
$network = 'Facebook';
|
490 |
+
$target =
|
491 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
492 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
493 |
+
&& false === isset(
|
494 |
+
$arr_settings['bar_call']
|
495 |
+
) )
|
496 |
+
||
|
497 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
498 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
499 |
+
&& false === isset(
|
500 |
+
$arr_settings['bar_call']
|
501 |
+
) )
|
502 |
+
||
|
503 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
504 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-facebook ssbp-btn' : '';
|
505 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
506 |
+
$html_share_buttons = '';
|
507 |
+
|
508 |
+
// Add li if plus.
|
509 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
510 |
+
$html_share_buttons .= '<li class="ssbp-li--facebook">';
|
511 |
+
}
|
512 |
+
|
513 |
+
// If the sharethis terms have been accepted.
|
514 |
+
if ( 'Y' === $arr_settings['accepted_sharethis_terms'] && '' !== $arr_settings['facebook_app_id'] ) {
|
515 |
+
// Facebook share link.
|
516 |
+
$html_share_buttons .= '<a data-site="" data-facebook="mobile" class="ssba_facebook_share' . esc_attr( $plus_class ) . '" data-href="' . esc_attr( $url_current_page ) . '" href="https://www.facebook.com/dialog/share?app_id=' . esc_attr( $arr_settings['facebook_app_id'] ) . '&display=popup&href=' . esc_attr( $url_current_page ) . '&redirect_uri=' . esc_url( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
517 |
+
} else {
|
518 |
+
// Facebook share link.
|
519 |
+
$html_share_buttons .= '<a data-site="" class="ssba_facebook_share' . esc_attr( $plus_class ) . '" href="http://www.facebook.com/sharer.php?u=' . esc_attr( $url_current_page ) . '" ' . $target . $nofollow . '>';
|
520 |
+
}
|
521 |
+
|
522 |
+
// If not using custom.
|
523 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
524 |
+
// Show selected ssba image.
|
525 |
+
$html_share_buttons .= '<img src="' . esc_url( plugins_url() ) . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/facebook.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Facebook" class="ssba ssba-img" alt="Share on Facebook" />';
|
526 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
527 |
+
// Show custom image.
|
528 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_facebook'] ) . '" title="Facebook" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" class="ssba ssba-img" alt="Share on Facebook" />';
|
529 |
+
}
|
530 |
+
|
531 |
+
// Close href.
|
532 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
533 |
+
|
534 |
+
// Close href.
|
535 |
+
$html_share_buttons .= '</a>';
|
536 |
+
|
537 |
+
// If show share count is set to Y.
|
538 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
539 |
+
||
|
540 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
541 |
+
||
|
542 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
543 |
+
)
|
544 |
+
&& $boo_show_share_count
|
545 |
+
) ) {
|
546 |
+
// Get and add facebook share count.
|
547 |
+
$html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->get_facebook_share_count( $url_current_page, $arr_settings ) ) . '</span>';
|
548 |
+
}
|
549 |
+
|
550 |
+
// Add closing li if plus.
|
551 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
552 |
+
$html_share_buttons .= '</li>';
|
553 |
+
}
|
554 |
+
|
555 |
+
// Return share buttons.
|
556 |
+
return $html_share_buttons;
|
557 |
+
}
|
558 |
+
|
559 |
+
/**
|
560 |
+
* Get set share buttons.
|
561 |
+
*
|
562 |
+
* @param array $arr_settings The current ssba settings.
|
563 |
+
* @param string $url_current_page The current pages url.
|
564 |
+
* @param string $str_page_title The page title.
|
565 |
+
* @param integer $int_post_id The post id.
|
566 |
+
*
|
567 |
+
* @return string
|
568 |
+
*/
|
569 |
+
public function get_share_bar( $arr_settings, $url_current_page, $str_page_title, $int_post_id ) {
|
570 |
+
// Variables.
|
571 |
+
$html_share_buttons = '';
|
572 |
+
|
573 |
+
// Set bar call.
|
574 |
+
$arr_settings = array_merge(
|
575 |
+
$arr_settings,
|
576 |
+
array(
|
577 |
+
'bar_call' => 'Y',
|
578 |
+
)
|
579 |
+
);
|
580 |
+
|
581 |
+
// Explode saved include list and add to a new array.
|
582 |
+
$arr_selected_ssba = explode( ',', $arr_settings['ssba_selected_bar_buttons'] );
|
583 |
+
|
584 |
+
// Check if array is not empty.
|
585 |
+
if ( '' !== $arr_settings['ssba_selected_bar_buttons'] ) {
|
586 |
+
// Add post ID to settings array.
|
587 |
+
$arr_settings['post_id'] = $int_post_id;
|
588 |
+
|
589 |
+
// If show counters option is selected.
|
590 |
+
if ( 'Y' === $arr_settings['ssba_bar_show_share_count'] ) {
|
591 |
+
// Set show flag to true.
|
592 |
+
$boo_show_share_count = true;
|
593 |
+
|
594 |
+
// If show counters once option is selected.
|
595 |
+
if ( isset( $arr_settings['ssba_bar_count_once'] ) && 'Y' === $arr_settings['ssba_bar_count_once'] ) {
|
596 |
+
// If not a page or post.
|
597 |
+
if ( ! is_page() && ! is_single() ) {
|
598 |
+
// Let show flag to false.
|
599 |
+
$boo_show_share_count = false;
|
600 |
+
}
|
601 |
+
}
|
602 |
+
} else {
|
603 |
+
// Set show flag to false.
|
604 |
+
$boo_show_share_count = false;
|
605 |
+
}
|
606 |
+
|
607 |
+
// For each included button.
|
608 |
+
foreach ( $arr_selected_ssba as $str_selected ) {
|
609 |
+
if ( '' !== $str_selected ) {
|
610 |
+
$str_get_button = 'ssba_' . $str_selected;
|
611 |
+
|
612 |
+
// Add a list item for each selected option.
|
613 |
+
$html_share_buttons .= $this->$str_get_button( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count );
|
614 |
+
}
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
// Return share buttons.
|
619 |
+
return $html_share_buttons;
|
620 |
+
}
|
621 |
+
|
622 |
+
/**
|
623 |
+
* Get facebook button.
|
624 |
+
*
|
625 |
+
* @param array $arr_settings The current ssba settings.
|
626 |
+
* @param string $url_current_page The current page url.
|
627 |
+
* @param string $str_page_title The page title.
|
628 |
+
* @param bool $boo_show_share_count Show share count or not.
|
629 |
+
*
|
630 |
+
* @return string
|
631 |
+
*/
|
632 |
+
public function ssba_facebook_save( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
633 |
+
$html_share_buttons = '';
|
634 |
+
|
635 |
+
// If the sharethis terms have been accepted.
|
636 |
+
if ( 'Y' === $arr_settings['accepted_sharethis_terms'] && ! isset( $arr_settings['bar_call'] ) ) {
|
637 |
+
// Add li if plus.
|
638 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
639 |
+
$html_share_buttons .= '<li class="ssbp-li--fb-save">';
|
640 |
+
}
|
641 |
+
|
642 |
+
// Add facebook save button.
|
643 |
+
$html_share_buttons .= '<span class="fb-save" style="display:inline-block" data-uri="' . esc_attr( $url_current_page ) . '"></span>';
|
644 |
+
|
645 |
+
// Add li if plus.
|
646 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || $arr_settings['bar_call'] ) {
|
647 |
+
$html_share_buttons .= '</li>';
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
return $html_share_buttons;
|
652 |
+
}
|
653 |
+
|
654 |
+
/**
|
655 |
+
* Get facebook share count.
|
656 |
+
*
|
657 |
+
* @param string $url_current_page Current url.
|
658 |
+
* @param array $arr_settings Current ssba settings.
|
659 |
+
*
|
660 |
+
* @return string
|
661 |
+
*/
|
662 |
+
public function get_facebook_share_count( $url_current_page, $arr_settings ) {
|
663 |
+
$cache_key = sprintf(
|
664 |
+
'facebook_sharecount_%s',
|
665 |
+
wp_hash( $url_current_page )
|
666 |
+
);
|
667 |
+
|
668 |
+
// Get the longer cached value from the Transient API.
|
669 |
+
$long_cached_count = get_transient( "ssba_{$cache_key}" );
|
670 |
+
if ( false === $long_cached_count ) {
|
671 |
+
$long_cached_count = 0;
|
672 |
+
}
|
673 |
+
|
674 |
+
// If sharedcount.com is enabled.
|
675 |
+
if ( ( ( 'Y' === $arr_settings['sharedcount_enabled'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
676 |
+
||
|
677 |
+
( isset( $arr_settings['plus_sharedcount_enabled'] ) && 'Y' === $arr_settings['plus_sharedcount_enabled'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
678 |
+
||
|
679 |
+
( isset( $arr_settings['bar_sharedcount_enabled'] ) && 'Y' === $arr_settings['bar_sharedcount_enabled'] && isset( $arr_settings['bar_call'] )
|
680 |
+
)
|
681 |
+
) ) {
|
682 |
+
|
683 |
+
$shared_plan = 'Y' !== $arr_settings['ssba_new_buttons'] ? $arr_settings['sharedcount_plan'] : '';
|
684 |
+
$shared_plan = '' === $shared_plan && 'Y' === $arr_settings['ssba_new_buttons'] ? $arr_settings['plus_sharedcount_plan'] : '';
|
685 |
+
$shared_plan = isset( $arr_settings['bar_call'] ) ? $arr_settings['bar_sharedcount_plan'] : '';
|
686 |
+
|
687 |
+
// Request from sharedcount.com.
|
688 |
+
$sharedcount = wp_safe_remote_get(
|
689 |
+
'https://' . $shared_plan . '.sharedcount.com/url?url=' . $url_current_page . '&apikey=' . $arr_settings['sharedcount_api_key'],
|
690 |
+
array(
|
691 |
+
'timeout' => 6,
|
692 |
+
)
|
693 |
+
);
|
694 |
+
|
695 |
+
// If no error.
|
696 |
+
if ( is_wp_error( $sharedcount ) ) {
|
697 |
+
return $this->ssba_format_number( $long_cached_count );
|
698 |
+
}
|
699 |
+
|
700 |
+
// Decode and return count.
|
701 |
+
$shared_resp = json_decode( $sharedcount['body'], true );
|
702 |
+
$sharedcount = $long_cached_count;
|
703 |
+
|
704 |
+
if ( isset( $shared_resp['Facebook']['share_count'] ) ) {
|
705 |
+
$sharedcount = (int) $shared_resp['Facebook']['share_count'];
|
706 |
+
wp_cache_set( $cache_key, $sharedcount, 'ssba', MINUTE_IN_SECONDS * 2 );
|
707 |
+
set_transient( "ssba_{$cache_key}", $sharedcount, DAY_IN_SECONDS );
|
708 |
+
}
|
709 |
+
|
710 |
+
return $this->ssba_format_number( $sharedcount );
|
711 |
+
} else {
|
712 |
+
// Get results from facebook.
|
713 |
+
$html_facebook_share_details = wp_safe_remote_get(
|
714 |
+
'http://graph.facebook.com/' . $url_current_page,
|
715 |
+
array(
|
716 |
+
'timeout' => 6,
|
717 |
+
)
|
718 |
+
);
|
719 |
+
|
720 |
+
// If no error.
|
721 |
+
if ( is_wp_error( $html_facebook_share_details ) ) {
|
722 |
+
return $this->ssba_format_number( $long_cached_count );
|
723 |
+
}
|
724 |
+
|
725 |
+
// Decode and return count.
|
726 |
+
$arr_facebook_share_details = json_decode( $html_facebook_share_details['body'], true );
|
727 |
+
$int_facebook_share_count = $long_cached_count;
|
728 |
+
|
729 |
+
if ( isset( $arr_facebook_share_details['share']['share_count'] ) ) {
|
730 |
+
$int_facebook_share_count = (int) $arr_facebook_share_details['share']['share_count'];
|
731 |
+
|
732 |
+
wp_cache_set( $cache_key, $int_facebook_share_count, 'ssba', MINUTE_IN_SECONDS * 2 );
|
733 |
+
set_transient( "ssba_{$cache_key}", $int_facebook_share_count, DAY_IN_SECONDS );
|
734 |
+
}
|
735 |
+
|
736 |
+
return $this->ssba_format_number( $int_facebook_share_count );
|
737 |
+
}
|
738 |
+
}
|
739 |
+
|
740 |
+
/**
|
741 |
+
* Get twitter button.
|
742 |
+
*
|
743 |
+
* @param array $arr_settings The current ssba settings.
|
744 |
+
* @param string $url_current_page The current page url.
|
745 |
+
* @param string $str_page_title The page title.
|
746 |
+
* @param bool $boo_show_share_count Show share count or not.
|
747 |
+
*
|
748 |
+
* @return string
|
749 |
+
*/
|
750 |
+
public function ssba_twitter( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
751 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
752 |
+
$network = 'Twitter';
|
753 |
+
$target =
|
754 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
755 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
756 |
+
&& ! isset(
|
757 |
+
$arr_settings['bar_call']
|
758 |
+
) )
|
759 |
+
||
|
760 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
761 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
762 |
+
&& ! isset(
|
763 |
+
$arr_settings['bar_call']
|
764 |
+
) )
|
765 |
+
||
|
766 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset(
|
767 |
+
$arr_settings['bar_call']
|
768 |
+
) ) ? ' target="_blank" ' : '';
|
769 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-twitter ssbp-btn' : '';
|
770 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
771 |
+
$html_share_buttons = '';
|
772 |
+
|
773 |
+
// Format the URL into friendly code.
|
774 |
+
$twitter_share_text = rawurlencode(
|
775 |
+
html_entity_decode(
|
776 |
+
$str_page_title . ' ' . $arr_settings['ssba_twitter_text'],
|
777 |
+
ENT_COMPAT,
|
778 |
+
'UTF-8'
|
779 |
+
)
|
780 |
+
);
|
781 |
+
|
782 |
+
// Add li if plus.
|
783 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
784 |
+
$html_share_buttons .= '<li class="ssbp-li--twitter">';
|
785 |
+
}
|
786 |
+
|
787 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] && ! empty( $arr_settings['ssba_plus_twitter_text'] ) ) {
|
788 |
+
$twitter_share_text = rawurlencode(
|
789 |
+
html_entity_decode(
|
790 |
+
$str_page_title . ' ' . $arr_settings['ssba_plus_twitter_text'],
|
791 |
+
ENT_COMPAT,
|
792 |
+
'UTF-8'
|
793 |
+
)
|
794 |
+
);
|
795 |
+
}
|
796 |
+
|
797 |
+
if ( isset( $arr_settings['bar_call'] ) && ! empty( $arr_settings['ssba_bar_twitter_text'] ) ) {
|
798 |
+
$twitter_share_text = rawurlencode(
|
799 |
+
html_entity_decode(
|
800 |
+
$str_page_title . ' ' . $arr_settings['ssba_bar_twitter_text'],
|
801 |
+
ENT_COMPAT,
|
802 |
+
'UTF-8'
|
803 |
+
)
|
804 |
+
);
|
805 |
+
}
|
806 |
+
|
807 |
+
// Twitter share link.
|
808 |
+
$html_share_buttons .= '<a data-site="" class="ssba_twitter_share' . esc_attr( $plus_class ) . '" href="http://twitter.com/share?url=' . esc_attr( $url_current_page ) . '&text=' . esc_attr( $twitter_share_text ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
809 |
+
|
810 |
+
// If image set is not custom.
|
811 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
812 |
+
// Show ssba image.
|
813 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/twitter.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Twitter" class="ssba ssba-img" alt="Tweet about this on Twitter" />';
|
814 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
815 |
+
// Show custom image.
|
816 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_twitter'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Twitter" class="ssba ssba-img" alt="Tweet about this on Twitter" />';
|
817 |
+
}
|
818 |
+
|
819 |
+
// Close href.
|
820 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
821 |
+
|
822 |
+
// Close href.
|
823 |
+
$html_share_buttons .= '</a>';
|
824 |
+
|
825 |
+
// Add closing li if plus.
|
826 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
827 |
+
$html_share_buttons .= '</li>';
|
828 |
+
}
|
829 |
+
|
830 |
+
// Return share buttons.
|
831 |
+
return $html_share_buttons;
|
832 |
+
}
|
833 |
+
|
834 |
+
/**
|
835 |
+
* Get google+ button.
|
836 |
+
*
|
837 |
+
* @param array $arr_settings The current ssba settings.
|
838 |
+
* @param string $url_current_page The current page url.
|
839 |
+
* @param string $str_page_title The page title.
|
840 |
+
* @param bool $boo_show_share_count Show share count or not.
|
841 |
+
*
|
842 |
+
* @return string
|
843 |
+
*/
|
844 |
+
public function ssba_google( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
845 |
+
return '';
|
846 |
+
}
|
847 |
+
|
848 |
+
/**
|
849 |
+
* Get google share count.
|
850 |
+
*
|
851 |
+
* @param string $url_current_page The current page url.
|
852 |
+
*
|
853 |
+
* @return string
|
854 |
+
*/
|
855 |
+
public function get_google_share_count( $url_current_page ) {
|
856 |
+
return '';
|
857 |
+
}
|
858 |
+
|
859 |
+
/**
|
860 |
+
* Get diggit button.
|
861 |
+
*
|
862 |
+
* @param array $arr_settings The current ssba settings.
|
863 |
+
* @param string $url_current_page The current page url.
|
864 |
+
* @param string $str_page_title The page title.
|
865 |
+
* @param bool $boo_show_share_count Show share count or not.
|
866 |
+
*
|
867 |
+
* @return string
|
868 |
+
*/
|
869 |
+
public function ssba_diggit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
870 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
871 |
+
$network = 'Digg';
|
872 |
+
$target =
|
873 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
874 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
875 |
+
&& ! isset(
|
876 |
+
$arr_settings['bar_call']
|
877 |
+
) )
|
878 |
+
||
|
879 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
880 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
881 |
+
&& ! isset(
|
882 |
+
$arr_settings['bar_call']
|
883 |
+
) )
|
884 |
+
||
|
885 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset(
|
886 |
+
$arr_settings['bar_call']
|
887 |
+
) ) ? ' target="_blank" ' : '';
|
888 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-diggit ssbp-btn' : '';
|
889 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
890 |
+
$html_share_buttons = '';
|
891 |
+
|
892 |
+
// Add li if plus.
|
893 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
894 |
+
$html_share_buttons .= '<li class="ssbp-li--diggit">';
|
895 |
+
}
|
896 |
+
|
897 |
+
// Diggit share link.
|
898 |
+
$html_share_buttons .= '<a data-site="digg" class="ssba_diggit_share ssba_share_link' . esc_attr( $plus_class ) . '" href="http://www.digg.com/submit?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
899 |
+
|
900 |
+
// If image set is not custom.
|
901 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
902 |
+
// Show ssba image.
|
903 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/diggit.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Digg" class="ssba ssba-img" alt="Digg this" />';
|
904 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
905 |
+
// Show custom image.
|
906 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_diggit'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Digg" class="ssba ssba-img" alt="Digg this" />';
|
907 |
+
}
|
908 |
+
|
909 |
+
// Close href.
|
910 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
911 |
+
|
912 |
+
// Close href.
|
913 |
+
$html_share_buttons .= '</a>';
|
914 |
+
|
915 |
+
// Add closing li if plus.
|
916 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
917 |
+
$html_share_buttons .= '</li>';
|
918 |
+
}
|
919 |
+
|
920 |
+
// Return share buttons.
|
921 |
+
return $html_share_buttons;
|
922 |
+
}
|
923 |
+
|
924 |
+
/**
|
925 |
+
* Get line button.
|
926 |
+
*
|
927 |
+
* @param array $arr_settings The current ssba settings.
|
928 |
+
* @param string $url_current_page The current page url.
|
929 |
+
* @param string $str_page_title The page title.
|
930 |
+
* @param bool $boo_show_share_count Show share count or not.
|
931 |
+
*
|
932 |
+
* @return string
|
933 |
+
*/
|
934 |
+
public function ssba_line( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
935 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
936 |
+
$network = 'Line';
|
937 |
+
$target =
|
938 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
939 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
940 |
+
&& ! isset( $arr_settings['bar_call'] ) )
|
941 |
+
||
|
942 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
943 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
944 |
+
&& ! isset( $arr_settings['bar_call'] ) )
|
945 |
+
||
|
946 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
947 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-line ssbp-btn' : '';
|
948 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
949 |
+
$html_share_buttons = '';
|
950 |
+
|
951 |
+
// Add li if plus.
|
952 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
953 |
+
$html_share_buttons .= '<li class="ssbp-li--line">';
|
954 |
+
}
|
955 |
+
|
956 |
+
// Line share link.
|
957 |
+
$html_share_buttons .= '<a data-site="line" class="ssba_line_share ssba_share_link' . esc_attr( $plus_class ) . '" href="https://lineit.line.me/share/ui?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
958 |
+
|
959 |
+
// If image set is not custom.
|
960 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
961 |
+
// Show ssba image.
|
962 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/line.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Line" />';
|
963 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
964 |
+
// Show custom image.
|
965 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_line'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Line" />';
|
966 |
+
}
|
967 |
+
|
968 |
+
// Close href.
|
969 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
970 |
+
|
971 |
+
// Close href.
|
972 |
+
$html_share_buttons .= '</a>';
|
973 |
+
|
974 |
+
// Add closing li if plus.
|
975 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
976 |
+
$html_share_buttons .= '</li>';
|
977 |
+
}
|
978 |
+
|
979 |
+
// Return share buttons.
|
980 |
+
return $html_share_buttons;
|
981 |
+
}
|
982 |
+
|
983 |
+
/**
|
984 |
+
* Get skype button.
|
985 |
+
*
|
986 |
+
* @param array $arr_settings The current ssba settings.
|
987 |
+
* @param string $url_current_page The current page url.
|
988 |
+
* @param string $str_page_title The page title.
|
989 |
+
* @param bool $boo_show_share_count Show share count or not.
|
990 |
+
*
|
991 |
+
* @return string
|
992 |
+
*/
|
993 |
+
public function ssba_skype( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
994 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
995 |
+
$network = 'Line';
|
996 |
+
$target =
|
997 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
998 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
999 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1000 |
+
||
|
1001 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1002 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1003 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1004 |
+
||
|
1005 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
1006 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-skype ssbp-btn' : '';
|
1007 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1008 |
+
$html_share_buttons = '';
|
1009 |
+
|
1010 |
+
// Add li if plus.
|
1011 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1012 |
+
$html_share_buttons .= '<li class="ssbp-li--skype">';
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
// Skype share link.
|
1016 |
+
$html_share_buttons .= '<a data-site="skype" class="ssba_skype_share ssba_share_link' . esc_attr( $plus_class ) . '" href="https://web.skype.com/share?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1017 |
+
|
1018 |
+
// If image set is not custom.
|
1019 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1020 |
+
// Show ssba image.
|
1021 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/line.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Skype" />';
|
1022 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1023 |
+
// Show custom image.
|
1024 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_skype'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Skype" class="ssba ssba-img" alt="skype" />';
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
// Close href.
|
1028 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1029 |
+
|
1030 |
+
// Close href.
|
1031 |
+
$html_share_buttons .= '</a>';
|
1032 |
+
|
1033 |
+
// Add closing li if plus.
|
1034 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1035 |
+
$html_share_buttons .= '</li>';
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
// Return share buttons.
|
1039 |
+
return $html_share_buttons;
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
/**
|
1043 |
+
* Get Flipboard button.
|
1044 |
+
*
|
1045 |
+
* @param array $arr_settings The current ssba settings.
|
1046 |
+
* @param string $url_current_page The current page url.
|
1047 |
+
* @param string $str_page_title The page title.
|
1048 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1049 |
+
*
|
1050 |
+
* @return string
|
1051 |
+
*/
|
1052 |
+
public function ssba_flipboard( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1053 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1054 |
+
$network = 'Flipboard';
|
1055 |
+
|
1056 |
+
$target =
|
1057 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1058 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1059 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1060 |
+
||
|
1061 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1062 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1063 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1064 |
+
||
|
1065 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
1066 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-flipboard ssbp-btn' : '';
|
1067 |
+
$html_share_buttons = '';
|
1068 |
+
|
1069 |
+
// Add li if plus.
|
1070 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1071 |
+
$html_share_buttons .= '<li class="ssbp-li--flipboard">';
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
// Flipboard share link.
|
1075 |
+
$html_share_buttons .= '<a data-site="flipboard" class="ssba_flipboard_share ssba_share_link'
|
1076 |
+
. esc_attr( $plus_class )
|
1077 |
+
. '" href="https://share.flipboard.com/bookmarklet/popout?url='
|
1078 |
+
. esc_attr( $url_current_page )
|
1079 |
+
. '&title='
|
1080 |
+
. esc_attr( rawurlencode( $str_page_title ) ) . '" '
|
1081 |
+
. esc_attr( $target . $nofollow )
|
1082 |
+
. '>';
|
1083 |
+
|
1084 |
+
// If image set is not custom.
|
1085 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1086 |
+
// Show ssba image.
|
1087 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/line.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Flipboard" />';
|
1088 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1089 |
+
// Show custom image.
|
1090 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_flipboard'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Flipboard" class="ssba ssba-img" alt="flipboard" />';
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
// Close href.
|
1094 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1095 |
+
|
1096 |
+
// Close href.
|
1097 |
+
$html_share_buttons .= '</a>';
|
1098 |
+
|
1099 |
+
// Add closing li if plus.
|
1100 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1101 |
+
$html_share_buttons .= '</li>';
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
// Return share buttons.
|
1105 |
+
return $html_share_buttons;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
/**
|
1109 |
+
* Get Telegram button.
|
1110 |
+
*
|
1111 |
+
* @param array $arr_settings The current ssba settings.
|
1112 |
+
* @param string $url_current_page The current page url.
|
1113 |
+
* @param string $str_page_title The page title.
|
1114 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1115 |
+
*
|
1116 |
+
* @return string
|
1117 |
+
*/
|
1118 |
+
public function ssba_telegram( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1119 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1120 |
+
$network = 'Telegram';
|
1121 |
+
|
1122 |
+
$target =
|
1123 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1124 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1125 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1126 |
+
||
|
1127 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1128 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1129 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1130 |
+
||
|
1131 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
1132 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-telegram ssbp-btn' : '';
|
1133 |
+
$html_share_buttons = '';
|
1134 |
+
|
1135 |
+
// Add li if plus.
|
1136 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1137 |
+
$html_share_buttons .= '<li class="ssbp-li--telegram">';
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// Telegram share link.
|
1141 |
+
$html_share_buttons .= '<a data-site="telegram" class="ssba_telegram_share ssba_share_link'
|
1142 |
+
. esc_attr( $plus_class )
|
1143 |
+
. '" href="https://telegram.me/share/url?url='
|
1144 |
+
. esc_attr( rawurlencode( $url_current_page ) )
|
1145 |
+
. '&text='
|
1146 |
+
. esc_attr( rawurlencode( $str_page_title ) ) . '">';
|
1147 |
+
|
1148 |
+
// If image set is not custom.
|
1149 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1150 |
+
// Show ssba image.
|
1151 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/line.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Telegram" />';
|
1152 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1153 |
+
// Show custom image.
|
1154 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_telegram'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Telegram" class="ssba ssba-img" alt="Telegram" />';
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
// Close href.
|
1158 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1159 |
+
|
1160 |
+
// Close href.
|
1161 |
+
$html_share_buttons .= '</a>';
|
1162 |
+
|
1163 |
+
// Add closing li if plus.
|
1164 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1165 |
+
$html_share_buttons .= '</li>';
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
// Return share buttons.
|
1169 |
+
return $html_share_buttons;
|
1170 |
+
}
|
1171 |
+
|
1172 |
+
|
1173 |
+
/**
|
1174 |
+
* Get Snapchat button.
|
1175 |
+
*
|
1176 |
+
* @param array $arr_settings The current ssba settings.
|
1177 |
+
* @param string $url_current_page The current page url.
|
1178 |
+
* @param string $str_page_title The page title.
|
1179 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1180 |
+
*
|
1181 |
+
* @return string
|
1182 |
+
*/
|
1183 |
+
public function ssba_snapchat( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1184 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1185 |
+
$network = 'Snapchat';
|
1186 |
+
|
1187 |
+
$target =
|
1188 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1189 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1190 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1191 |
+
||
|
1192 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1193 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1194 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1195 |
+
||
|
1196 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
1197 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-snapchat ssbp-btn' : '';
|
1198 |
+
$html_share_buttons = '';
|
1199 |
+
|
1200 |
+
// Add li if plus.
|
1201 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1202 |
+
$html_share_buttons .= '<li class="ssbp-li--snapchat">';
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
// Snapchat share link.
|
1206 |
+
$html_share_buttons .= '<a data-site="snapchat" class="ssba_snapchat_share ssba_share_link' . esc_attr( $plus_class ) . '" href="https://snapchat.com/scan?attachmentUrl=' . esc_attr( $url_current_page ) . '&utm_source=sharethis" ' . esc_attr( $target . $nofollow ) . '>';
|
1207 |
+
|
1208 |
+
// If image set is not custom.
|
1209 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1210 |
+
// Show ssba image.
|
1211 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/line.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Line" class="ssba ssba-img" alt="Snapchat" />';
|
1212 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1213 |
+
// Show custom image.
|
1214 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_snapchat'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Snapchat" class="ssba ssba-img" alt="Snapchat" />';
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
// Close href.
|
1218 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1219 |
+
|
1220 |
+
// Close href.
|
1221 |
+
$html_share_buttons .= '</a>';
|
1222 |
+
|
1223 |
+
// Add closing li if plus.
|
1224 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1225 |
+
$html_share_buttons .= '</li>';
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
// Return share buttons.
|
1229 |
+
return $html_share_buttons;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
/**
|
1233 |
+
* Get weibo button.
|
1234 |
+
*
|
1235 |
+
* @param array $arr_settings The current ssba settings.
|
1236 |
+
* @param string $url_current_page The current page url.
|
1237 |
+
* @param string $str_page_title The page title.
|
1238 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1239 |
+
*
|
1240 |
+
* @return string
|
1241 |
+
*/
|
1242 |
+
public function ssba_weibo( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1243 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1244 |
+
$network = 'Line';
|
1245 |
+
$target =
|
1246 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1247 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1248 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1249 |
+
||
|
1250 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1251 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1252 |
+
&& false === isset( $arr_settings['bar_call'] ) )
|
1253 |
+
||
|
1254 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call'] ) ) ? ' target="_blank" ' : '';
|
1255 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-weibo ssbp-btn' : '';
|
1256 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1257 |
+
$html_share_buttons = '';
|
1258 |
+
|
1259 |
+
// Add li if plus.
|
1260 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1261 |
+
$html_share_buttons .= '<li class="ssbp-li--weibo">';
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
// Skype share link.
|
1265 |
+
$html_share_buttons .= '<a data-site="weibo" class="ssba_weibo_share ssba_share_link' . esc_attr( $plus_class ) . '" href="http://v.t.sina.com.cn/share/share.php?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1266 |
+
|
1267 |
+
// If image set is not custom.
|
1268 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1269 |
+
// Show ssba image.
|
1270 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/weibo.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Weibo" class="ssba ssba-img" alt="Weibo" />';
|
1271 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1272 |
+
// Show custom image.
|
1273 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_weibo'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Weibo" class="ssba ssba-img" alt="Weibo" />';
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
// Close href.
|
1277 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1278 |
+
|
1279 |
+
// Close href.
|
1280 |
+
$html_share_buttons .= '</a>';
|
1281 |
+
|
1282 |
+
// Add closing li if plus.
|
1283 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1284 |
+
$html_share_buttons .= '</li>';
|
1285 |
+
}
|
1286 |
+
|
1287 |
+
// Return share buttons.
|
1288 |
+
return $html_share_buttons;
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
/**
|
1292 |
+
* Get reddit.
|
1293 |
+
*
|
1294 |
+
* @param array $arr_settings The current ssba settings.
|
1295 |
+
* @param string $url_current_page The current page url.
|
1296 |
+
* @param string $str_page_title The page title.
|
1297 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1298 |
+
*
|
1299 |
+
* @return string
|
1300 |
+
*/
|
1301 |
+
public function ssba_reddit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1302 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1303 |
+
$network = 'Reddit';
|
1304 |
+
$target =
|
1305 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1306 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1307 |
+
&& false === isset(
|
1308 |
+
$arr_settings['bar_call']
|
1309 |
+
) )
|
1310 |
+
||
|
1311 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1312 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1313 |
+
&& false === isset(
|
1314 |
+
$arr_settings['bar_call']
|
1315 |
+
) )
|
1316 |
+
||
|
1317 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset(
|
1318 |
+
$arr_settings['bar_call']
|
1319 |
+
) ) ? ' target="_blank" ' : '';
|
1320 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-reddit ssbp-btn' : '';
|
1321 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1322 |
+
$html_share_buttons = '';
|
1323 |
+
|
1324 |
+
// Add li if plus.
|
1325 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1326 |
+
$html_share_buttons .= '<li class="ssbp-li--reddit">';
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
// Reddit share link.
|
1330 |
+
$html_share_buttons .= '<a data-site="reddit" class="ssba_reddit_share' . esc_attr( $plus_class ) . '" href="http://reddit.com/submit?url=' . esc_attr( $url_current_page ) . '&title=' . esc_attr( $str_page_title ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1331 |
+
|
1332 |
+
// If image set is not custom.
|
1333 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1334 |
+
|
1335 |
+
// Show ssba image.
|
1336 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/reddit.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Reddit" class="ssba ssba-img" alt="Share on Reddit" />';
|
1337 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1338 |
+
// Show custom image.
|
1339 |
+
$html_share_buttons .= '<img src="' . esc_attr( $arr_settings['ssba_custom_reddit'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Reddit" class="ssba ssba-img" alt="Share on Reddit" />';
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
// Close href.
|
1343 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1344 |
+
|
1345 |
+
// Close href.
|
1346 |
+
$html_share_buttons .= '</a>';
|
1347 |
+
|
1348 |
+
// If show share count is set to Y.
|
1349 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
1350 |
+
||
|
1351 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
1352 |
+
||
|
1353 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
1354 |
+
)
|
1355 |
+
&& $boo_show_share_count
|
1356 |
+
) ) {
|
1357 |
+
// Get and display share count.
|
1358 |
+
$html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->get_reddit_share_count( $url_current_page ) ) . '</span>';
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
// Add closing li if plus.
|
1362 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1363 |
+
$html_share_buttons .= '</li>';
|
1364 |
+
}
|
1365 |
+
|
1366 |
+
// Return share buttons.
|
1367 |
+
return $html_share_buttons;
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
/**
|
1371 |
+
* Get reddit share count.
|
1372 |
+
*
|
1373 |
+
* @param string $url_current_page The current url.
|
1374 |
+
*
|
1375 |
+
* @return int|string
|
1376 |
+
*/
|
1377 |
+
public function get_reddit_share_count( $url_current_page ) {
|
1378 |
+
// Get results from reddit and return the number of shares.
|
1379 |
+
$html_reddit_share_details = wp_safe_remote_get(
|
1380 |
+
'http://www.reddit.com/api/info.json?url=' . $url_current_page,
|
1381 |
+
array(
|
1382 |
+
'timeout' => 6,
|
1383 |
+
)
|
1384 |
+
);
|
1385 |
+
|
1386 |
+
// Check there was an error.
|
1387 |
+
if ( is_wp_error( $html_reddit_share_details ) ) {
|
1388 |
+
return 0;
|
1389 |
+
}
|
1390 |
+
|
1391 |
+
// Decode and get share count.
|
1392 |
+
$arr_reddit_result = json_decode( $html_reddit_share_details['body'], true );
|
1393 |
+
$int_reddit_share_count = isset( $arr_reddit_result['data']['children']['0']['data']['score'] ) ? $arr_reddit_result['data']['children']['0']['data']['score'] : 0;
|
1394 |
+
|
1395 |
+
return $int_reddit_share_count ? $this->ssba_format_number( $int_reddit_share_count ) : '0';
|
1396 |
+
}
|
1397 |
+
|
1398 |
+
/**
|
1399 |
+
* Get linkedin button.
|
1400 |
+
*
|
1401 |
+
* @param array $arr_settings The current ssba settings.
|
1402 |
+
* @param string $url_current_page The current page url.
|
1403 |
+
* @param string $str_page_title The page title.
|
1404 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1405 |
+
*
|
1406 |
+
* @return string
|
1407 |
+
*/
|
1408 |
+
public function ssba_linkedin( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1409 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1410 |
+
$network = 'Linkedin';
|
1411 |
+
$target =
|
1412 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1413 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1414 |
+
&& ! isset(
|
1415 |
+
$arr_settings['bar_call']
|
1416 |
+
) )
|
1417 |
+
||
|
1418 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1419 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1420 |
+
&& ! isset(
|
1421 |
+
$arr_settings['bar_call']
|
1422 |
+
) )
|
1423 |
+
||
|
1424 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1425 |
+
&& isset(
|
1426 |
+
$arr_settings['bar_call']
|
1427 |
+
) ) ? ' target="_blank" ' : '';
|
1428 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-linkedin ssbp-btn' : '';
|
1429 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1430 |
+
$html_share_buttons = '';
|
1431 |
+
|
1432 |
+
// Add li if plus.
|
1433 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1434 |
+
$html_share_buttons .= '<li class="ssbp-li--linkedin">';
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
// Linkedin share link.
|
1438 |
+
$html_share_buttons .= '<a data-site="linkedin" class="ssba_linkedin_share ssba_share_link' . esc_attr( $plus_class ) . '" href="http://www.linkedin.com/shareArticle?mini=true&url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1439 |
+
|
1440 |
+
// If image set is not custom.
|
1441 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1442 |
+
// Show ssba image.
|
1443 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/linkedin.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="LinkedIn" class="ssba ssba-img" alt="Share on LinkedIn" />';
|
1444 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1445 |
+
// Show custom image.
|
1446 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_linkedin'] ) . '" alt="Share on LinkedIn" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="LinkedIn" class="ssba ssba-img" />';
|
1447 |
+
}
|
1448 |
+
|
1449 |
+
// Close href.
|
1450 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1451 |
+
|
1452 |
+
// Close href.
|
1453 |
+
$html_share_buttons .= '</a>';
|
1454 |
+
|
1455 |
+
// Add closing li if plus.
|
1456 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1457 |
+
$html_share_buttons .= '</li>';
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
// Return share buttons.
|
1461 |
+
return $html_share_buttons;
|
1462 |
+
}
|
1463 |
+
|
1464 |
+
/**
|
1465 |
+
* Get linkedin share count. DEPRECATED
|
1466 |
+
*
|
1467 |
+
* @param string $url_current_page The current page url.
|
1468 |
+
*
|
1469 |
+
* @return int|string
|
1470 |
+
*/
|
1471 |
+
public function get_linkedin_share_count( $url_current_page ) {
|
1472 |
+
// Get results from linkedin and return the number of shares.
|
1473 |
+
$html_linkedin_share_details = wp_safe_remote_get(
|
1474 |
+
'http://www.linkedin.com/countserv/count/share?url=' . $url_current_page,
|
1475 |
+
array(
|
1476 |
+
'timeout' => 6,
|
1477 |
+
)
|
1478 |
+
);
|
1479 |
+
|
1480 |
+
// If there was an error.
|
1481 |
+
if ( is_wp_error( $html_linkedin_share_details ) ) {
|
1482 |
+
return 0;
|
1483 |
+
}
|
1484 |
+
|
1485 |
+
// Extract/decode share count.
|
1486 |
+
$html_linkedin_share_details = str_replace( 'IN.Tags.Share.handleCount(', '', $html_linkedin_share_details );
|
1487 |
+
$html_linkedin_share_details = str_replace( ');', '', $html_linkedin_share_details );
|
1488 |
+
$arr_linkedin_share_details = json_decode( $html_linkedin_share_details['body'], true );
|
1489 |
+
$int_linkedin_share_count = $arr_linkedin_share_details['count'];
|
1490 |
+
|
1491 |
+
return $int_linkedin_share_count ? $this->ssba_format_number( $int_linkedin_share_count ) : '0';
|
1492 |
+
}
|
1493 |
+
|
1494 |
+
/**
|
1495 |
+
* Get pinterest button.
|
1496 |
+
*
|
1497 |
+
* @param array $arr_settings The current ssba settings.
|
1498 |
+
* @param string $url_current_page The current page url.
|
1499 |
+
* @param string $str_page_title The page title.
|
1500 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1501 |
+
*
|
1502 |
+
* @return string
|
1503 |
+
*/
|
1504 |
+
public function ssba_pinterest( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1505 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1506 |
+
$network = 'Pinterest';
|
1507 |
+
$target =
|
1508 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1509 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1510 |
+
&& false === isset(
|
1511 |
+
$arr_settings['bar_call']
|
1512 |
+
) )
|
1513 |
+
||
|
1514 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1515 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1516 |
+
&& false === isset(
|
1517 |
+
$arr_settings['bar_call']
|
1518 |
+
) )
|
1519 |
+
||
|
1520 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1521 |
+
&& true === isset(
|
1522 |
+
$arr_settings['bar_call']
|
1523 |
+
) ) ? ' target="_blank" ' : '';
|
1524 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-pinterest ssbp-btn' : '';
|
1525 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1526 |
+
$html_share_buttons = '';
|
1527 |
+
|
1528 |
+
// Add li if plus.
|
1529 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1530 |
+
$html_share_buttons .= '<li class="ssbp-li--pinterest">';
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
// If using featured images for Pinteres.
|
1534 |
+
if ( 'Y' === $arr_settings['ssba_pinterest_featured'] ) {
|
1535 |
+
// If this post has a featured image.
|
1536 |
+
if ( has_post_thumbnail( $arr_settings['post_id'] ) ) {
|
1537 |
+
// Get the featured image.
|
1538 |
+
$url_post_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $arr_settings['post_id'] ), 'full' );
|
1539 |
+
$url_post_thumb = $url_post_thumb[0];
|
1540 |
+
} else { // No featured image set.
|
1541 |
+
// Use the pinterest default.
|
1542 |
+
$url_post_thumb = $arr_settings['ssba_default_pinterest'];
|
1543 |
+
}
|
1544 |
+
|
1545 |
+
// Pinterest share link.
|
1546 |
+
$html_share_buttons .= '<a data-site="pinterest-featured" href="http://pinterest.com/pin/create/bookmarklet/?is_video=false&url=' . esc_attr( $url_current_page ) . '&media=' . esc_attr( $url_post_thumb ) . '&description=' . esc_attr( $str_page_title ) . '" class="ssba_pinterest_share ssba_share_link' . esc_attr( $plus_class ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1547 |
+
} else { // Not using featured images for pinterest.
|
1548 |
+
// Use the choice of pinnable images approach.
|
1549 |
+
$html_share_buttons .= "<a data-site='pinterest' class='ssba_pinterest_share" . esc_attr( $plus_class ) . "' href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'>";
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
// If image set is not custom.
|
1553 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1554 |
+
// Show ssba image.
|
1555 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/pinterest.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Pinterest" class="ssba ssba-img" alt="Pin on Pinterest" />';
|
1556 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1557 |
+
// Show custom image.
|
1558 |
+
$html_share_buttons .= '<img style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Pinterest" class="ssba ssba-img" src="' . esc_url( $arr_settings['ssba_custom_pinterest'] ) . '" alt="Pin on Pinterest" />';
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
// Close href.
|
1562 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1563 |
+
|
1564 |
+
// Close href.
|
1565 |
+
$html_share_buttons .= '</a>';
|
1566 |
+
|
1567 |
+
// If show share count is set to Y.
|
1568 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
1569 |
+
||
|
1570 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
1571 |
+
||
|
1572 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
1573 |
+
)
|
1574 |
+
&& $boo_show_share_count
|
1575 |
+
) ) {
|
1576 |
+
$html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->get_pinterest_share_count( $url_current_page ) ) . '</span>';
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
// Add closing li if plus.
|
1580 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1581 |
+
$html_share_buttons .= '</li>';
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
// Return share buttons.
|
1585 |
+
return $html_share_buttons;
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
/**
|
1589 |
+
* Get pinterest share count.
|
1590 |
+
*
|
1591 |
+
* @param string $url_current_page The current page url.
|
1592 |
+
*
|
1593 |
+
* @return int|string
|
1594 |
+
*/
|
1595 |
+
public function get_pinterest_share_count( $url_current_page ) {
|
1596 |
+
// Get results from pinterest.
|
1597 |
+
$html_pinterest_share_details = wp_safe_remote_get(
|
1598 |
+
'http://api.pinterest.com/v1/urls/count.json?url=' . $url_current_page,
|
1599 |
+
array(
|
1600 |
+
'timeout' => 6,
|
1601 |
+
)
|
1602 |
+
);
|
1603 |
+
|
1604 |
+
// Check there was an error.
|
1605 |
+
if ( is_wp_error( $html_pinterest_share_details ) ) {
|
1606 |
+
return 0;
|
1607 |
+
}
|
1608 |
+
|
1609 |
+
// Decode data.
|
1610 |
+
$html_pinterest_share_details = str_replace( 'receiveCount(', '', $html_pinterest_share_details );
|
1611 |
+
$html_pinterest_share_details = str_replace( ')', '', $html_pinterest_share_details );
|
1612 |
+
$arr_pinterest_share_details = json_decode( $html_pinterest_share_details['body'], true );
|
1613 |
+
$int_pinterest_share_count = $arr_pinterest_share_details['count'];
|
1614 |
+
|
1615 |
+
return $int_pinterest_share_count ? $this->ssba_format_number( $int_pinterest_share_count ) : '0';
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
/**
|
1619 |
+
* Get stumbleupon button.
|
1620 |
+
*
|
1621 |
+
* @param array $arr_settings The current ssba settings.
|
1622 |
+
* @param string $url_current_page The current page url.
|
1623 |
+
* @param string $str_page_title The page title.
|
1624 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1625 |
+
*
|
1626 |
+
* @return string
|
1627 |
+
*/
|
1628 |
+
public function ssba_stumbleupon( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1629 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1630 |
+
$network = 'StumbleUpon';
|
1631 |
+
$target =
|
1632 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1633 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1634 |
+
&& false === isset(
|
1635 |
+
$arr_settings['bar_call']
|
1636 |
+
) )
|
1637 |
+
||
|
1638 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1639 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1640 |
+
&& false === isset(
|
1641 |
+
$arr_settings['bar_call']
|
1642 |
+
) )
|
1643 |
+
||
|
1644 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1645 |
+
&& isset(
|
1646 |
+
$arr_settings['bar_call']
|
1647 |
+
) ) ? ' target="_blank" ' : '';
|
1648 |
+
$url = 'http://www.stumbleupon.com/submit?url=' . esc_attr( $url_current_page ) . '&title=' . esc_attr( $str_page_title );
|
1649 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-stumbleupon ssbp-btn' : '';
|
1650 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1651 |
+
$html_share_buttons = '';
|
1652 |
+
|
1653 |
+
// Add li if plus.
|
1654 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1655 |
+
$html_share_buttons .= '<li class="ssbp-li--stumbleupon">';
|
1656 |
+
}
|
1657 |
+
|
1658 |
+
// Stumbleupon share link.
|
1659 |
+
$html_share_buttons .= '<a data-site="stumbleupon" class="ssba_stumbleupon_share ssba_share_link' . esc_attr( $plus_class ) . '" href="' . esc_url( $url ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1660 |
+
|
1661 |
+
// If image set is not custom.
|
1662 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1663 |
+
// Show ssba image.
|
1664 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/stumbleupon.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="StumbleUpon" class="ssba ssba-img" alt="Share on StumbleUpon" />';
|
1665 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1666 |
+
// Show custom image.
|
1667 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_stumbleupon'] ) . '" alt="Share on StumbleUpon" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="StumbleUpon" class="ssba ssba-img" />';
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
// Close href.
|
1671 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1672 |
+
|
1673 |
+
// Close href.
|
1674 |
+
$html_share_buttons .= '</a>';
|
1675 |
+
|
1676 |
+
// If show share count is set to Y.
|
1677 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
1678 |
+
||
|
1679 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
1680 |
+
||
|
1681 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
1682 |
+
)
|
1683 |
+
&& $boo_show_share_count
|
1684 |
+
) ) {
|
1685 |
+
$html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->get_stumble_upon_share_count( $url_current_page ) ) . '</span>';
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
// Add closing li if plus.
|
1689 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1690 |
+
$html_share_buttons .= '</li>';
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
// Return share buttons.
|
1694 |
+
return $html_share_buttons;
|
1695 |
+
}
|
1696 |
+
|
1697 |
+
/**
|
1698 |
+
* Get stumbleupon share count.
|
1699 |
+
*
|
1700 |
+
* @param string $url_current_page The current url.
|
1701 |
+
*
|
1702 |
+
* @return int|string
|
1703 |
+
*/
|
1704 |
+
public function get_stumble_upon_share_count( $url_current_page ) {
|
1705 |
+
// Get results from stumbleupon and return the number of shares.
|
1706 |
+
$html_stumble_upon_share_details = wp_safe_remote_get(
|
1707 |
+
'http://www.stumbleupon.com/services/1.01/badge.getinfo?url=' . $url_current_page,
|
1708 |
+
array(
|
1709 |
+
'timeout' => 6,
|
1710 |
+
)
|
1711 |
+
);
|
1712 |
+
|
1713 |
+
// Check there was an error.
|
1714 |
+
if ( is_wp_error( $html_stumble_upon_share_details ) ) {
|
1715 |
+
return 0;
|
1716 |
+
}
|
1717 |
+
|
1718 |
+
// Decode data.
|
1719 |
+
$arr_stumble_upon_result = json_decode( $html_stumble_upon_share_details['body'], true );
|
1720 |
+
$int_stumble_upon_share_count = isset( $arr_stumble_upon_result['result']['views'] ) ? $arr_stumble_upon_result['result']['views'] : 0;
|
1721 |
+
|
1722 |
+
return $int_stumble_upon_share_count ? $this->ssba_format_number( $int_stumble_upon_share_count ) : '0';
|
1723 |
+
}
|
1724 |
+
|
1725 |
+
/**
|
1726 |
+
* Get email button.
|
1727 |
+
*
|
1728 |
+
* @param array $arr_settings The current ssba settings.
|
1729 |
+
* @param string $url_current_page The current page url.
|
1730 |
+
* @param string $str_page_title The page title.
|
1731 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1732 |
+
*
|
1733 |
+
* @return string
|
1734 |
+
*/
|
1735 |
+
public function ssba_email( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1736 |
+
// Replace ampersands as needed for email link.
|
1737 |
+
$email_title = str_replace( '&', '%26', $str_page_title );
|
1738 |
+
$network = 'email';
|
1739 |
+
$url = 'mailto:?subject=' . $email_title . '&body=' . $arr_settings['ssba_email_message'] . ' ' . $url_current_page;
|
1740 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-email ssbp-btn' : '';
|
1741 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1742 |
+
$html_share_buttons = '';
|
1743 |
+
|
1744 |
+
// Add li if plus.
|
1745 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1746 |
+
$html_share_buttons .= '<li class="ssbp-li--email">';
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
$url = 'Y' === $arr_settings['ssba_new_buttons'] ? 'mailto:?subject=' . $email_title . '&body=' . $arr_settings['ssba_plus_email_message'] . ' ' . $url_current_page : $url;
|
1750 |
+
$url = isset( $arr_settings['bar_call'] ) ? 'mailto:?subject=' . $email_title . '&body=' . $arr_settings['ssba_bar_email_message'] . ' ' . $url_current_page : $url;
|
1751 |
+
|
1752 |
+
// Email share link.
|
1753 |
+
$html_share_buttons .= '<a data-site="email" class="ssba_email_share' . esc_attr( $plus_class ) . '" href="' . esc_url( $url ) . '">';
|
1754 |
+
|
1755 |
+
// If image set is not custom.
|
1756 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1757 |
+
// Show ssba image.
|
1758 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/email.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Email" class="ssba ssba-img" alt="Email this to someone" />';
|
1759 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1760 |
+
// Show custom image.
|
1761 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_email'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Email" class="ssba ssba-img" alt="Email to someone" />';
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
// Close href.
|
1765 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1766 |
+
|
1767 |
+
// Close href.
|
1768 |
+
$html_share_buttons .= '</a>';
|
1769 |
+
|
1770 |
+
// Add closing li if plus.
|
1771 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1772 |
+
$html_share_buttons .= '</li>';
|
1773 |
+
}
|
1774 |
+
|
1775 |
+
// Return share buttons.
|
1776 |
+
return $html_share_buttons;
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
/**
|
1780 |
+
* Get flattr button.
|
1781 |
+
*
|
1782 |
+
* @param array $arr_settings The current ssba settings.
|
1783 |
+
* @param string $url_current_page The current page url.
|
1784 |
+
* @param string $str_page_title The page title.
|
1785 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1786 |
+
*
|
1787 |
+
* @return string
|
1788 |
+
*/
|
1789 |
+
public function ssba_flattr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1790 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1791 |
+
$network = 'Flattr';
|
1792 |
+
$target =
|
1793 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1794 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1795 |
+
&& false === isset(
|
1796 |
+
$arr_settings['bar_call']
|
1797 |
+
) )
|
1798 |
+
||
|
1799 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1800 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1801 |
+
&& false === isset(
|
1802 |
+
$arr_settings['bar_call']
|
1803 |
+
) )
|
1804 |
+
||
|
1805 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1806 |
+
&& isset(
|
1807 |
+
$arr_settings['bar_call']
|
1808 |
+
) ) ? ' target="_blank" ' : '';
|
1809 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-flattr ssbp-btn' : '';
|
1810 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1811 |
+
$html_share_buttons = '';
|
1812 |
+
$userid = ! empty( $arr_settings['ssba_flattr_user_id'] ) ? $arr_settings['ssba_flattr_user_id'] : '';
|
1813 |
+
|
1814 |
+
// Add li if plus.
|
1815 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1816 |
+
$html_share_buttons .= '<li class="ssbp-li--flattr">';
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
// Check for dedicated flattr URL.
|
1820 |
+
if ( '' !== $arr_settings['ssba_flattr_url'] ) {
|
1821 |
+
// Update url that will be set to specified URL.
|
1822 |
+
$url_current_page = $arr_settings['ssba_flattr_url'];
|
1823 |
+
}
|
1824 |
+
|
1825 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] ) {
|
1826 |
+
$userid = ! empty( $arr_settings['ssba_plus_flattr_user_id'] ) ? $arr_settings['ssba_plus_flattr_user_id'] : $userid;
|
1827 |
+
$url_current_page = ! empty( $arr_settings['ssba_plus_flattr_url'] ) ? $arr_settings['ssba_plus_flattr_url'] : $url_current_page;
|
1828 |
+
}
|
1829 |
+
|
1830 |
+
if ( isset( $arr_settings['bar_call'] ) ) {
|
1831 |
+
$userid = ! empty( $arr_settings['ssba_bar_flattr_user_id'] ) ? $arr_settings['ssba_bar_flattr_user_id'] : $userid;
|
1832 |
+
$url_current_page = ! empty( $arr_settings['ssba_bar_flattr_url'] ) ? $arr_settings['ssba_bar_flattr_url'] : $url_current_page;
|
1833 |
+
}
|
1834 |
+
|
1835 |
+
// Flattr share link.
|
1836 |
+
$html_share_buttons .= '<a data-site="flattr" class="ssba_flattr_share' . esc_attr( $plus_class ) . '" href="https://flattr.com/submit/auto?user_id=' . esc_attr( $userid ) . '&title=' . esc_attr( $str_page_title ) . '&url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1837 |
+
|
1838 |
+
// If image set is not custom.
|
1839 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1840 |
+
// Show ssba image.
|
1841 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/flattr.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Flattr" class="ssba ssba-img" alt="Flattr the author" />';
|
1842 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1843 |
+
// Show custom image.
|
1844 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_flattr'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Flattr" class="ssba ssba-img" alt="Flattr the author" />';
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
// Close href.
|
1848 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1849 |
+
|
1850 |
+
// Close href.
|
1851 |
+
$html_share_buttons .= '</a>';
|
1852 |
+
|
1853 |
+
// Add closing li if plus.
|
1854 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1855 |
+
$html_share_buttons .= '</li>';
|
1856 |
+
}
|
1857 |
+
|
1858 |
+
// Return share buttons.
|
1859 |
+
return $html_share_buttons;
|
1860 |
+
}
|
1861 |
+
|
1862 |
+
/**
|
1863 |
+
* Get buffer button.
|
1864 |
+
*
|
1865 |
+
* @param array $arr_settings The current ssba settings.
|
1866 |
+
* @param string $url_current_page The current page url.
|
1867 |
+
* @param string $str_page_title The page title.
|
1868 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1869 |
+
*
|
1870 |
+
* @return string
|
1871 |
+
*/
|
1872 |
+
public function ssba_buffer( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1873 |
+
$buffer = '' !== $arr_settings['ssba_buffer_text'] ? $arr_settings['ssba_buffer_text'] : '';
|
1874 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1875 |
+
$network = 'Buffer';
|
1876 |
+
$target =
|
1877 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1878 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1879 |
+
&& ! isset(
|
1880 |
+
$arr_settings['bar_call']
|
1881 |
+
) )
|
1882 |
+
||
|
1883 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1884 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1885 |
+
&& ! isset(
|
1886 |
+
$arr_settings['bar_call']
|
1887 |
+
) )
|
1888 |
+
||
|
1889 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1890 |
+
&& isset(
|
1891 |
+
$arr_settings['bar_call']
|
1892 |
+
) ) ? ' target="_blank" ' : '';
|
1893 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-buffer ssbp-btn' : '';
|
1894 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1895 |
+
$html_share_buttons = '';
|
1896 |
+
|
1897 |
+
// Add li if plus.
|
1898 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1899 |
+
$html_share_buttons .= '<li class="ssbp-li--buffer">';
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
// Buffer share link.
|
1903 |
+
$html_share_buttons .= '<a data-site="buffer" class="ssba_buffer_share' . esc_attr( $plus_class ) . '" href="https://bufferapp.com/add?url=' . esc_attr( $url_current_page ) . '&text=' . esc_attr( $buffer ) . ' ' . esc_attr( $str_page_title ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1904 |
+
|
1905 |
+
// If image set is not custom.
|
1906 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1907 |
+
// Show ssba image.
|
1908 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/buffer.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Buffer" class="ssba ssba-img" alt="Buffer this page" />';
|
1909 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1910 |
+
// Show custom image.
|
1911 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_buffer'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Buffer" class="ssba ssba-img" alt="Buffer this page" />';
|
1912 |
+
}
|
1913 |
+
|
1914 |
+
// Close href.
|
1915 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1916 |
+
|
1917 |
+
// Close href.
|
1918 |
+
$html_share_buttons .= '</a>';
|
1919 |
+
|
1920 |
+
// Add closing li if plus.
|
1921 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1922 |
+
$html_share_buttons .= '</li>';
|
1923 |
+
}
|
1924 |
+
|
1925 |
+
// Return share buttons.
|
1926 |
+
return $html_share_buttons;
|
1927 |
+
}
|
1928 |
+
|
1929 |
+
/**
|
1930 |
+
* Get tumblr button.
|
1931 |
+
*
|
1932 |
+
* @param array $arr_settings The current ssba settings.
|
1933 |
+
* @param string $url_current_page The current page url.
|
1934 |
+
* @param string $str_page_title The page title.
|
1935 |
+
* @param bool $boo_show_share_count Show share count or not.
|
1936 |
+
*
|
1937 |
+
* @return string
|
1938 |
+
*/
|
1939 |
+
public function ssba_tumblr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
1940 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
1941 |
+
$network = 'Tumblr';
|
1942 |
+
$target =
|
1943 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
1944 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
1945 |
+
&& ! isset(
|
1946 |
+
$arr_settings['bar_call']
|
1947 |
+
) )
|
1948 |
+
||
|
1949 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
1950 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
1951 |
+
&& ! isset(
|
1952 |
+
$arr_settings['bar_call']
|
1953 |
+
) )
|
1954 |
+
||
|
1955 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
1956 |
+
&& isset(
|
1957 |
+
$arr_settings['bar_call']
|
1958 |
+
) ) ? ' target="_blank" ' : '';
|
1959 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-tumblr ssbp-btn' : '';
|
1960 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
1961 |
+
$html_share_buttons = '';
|
1962 |
+
|
1963 |
+
// Add li if plus.
|
1964 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
1965 |
+
$html_share_buttons .= '<li class="ssbp-li--tumblr">';
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
// Tumblr share link.
|
1969 |
+
$html_share_buttons .= '<a data-site="tumblr" class="ssba_tumblr_share' . esc_attr( $plus_class ) . '" href="http://www.tumblr.com/share/link?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
1970 |
+
|
1971 |
+
// If image set is not custom.
|
1972 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
1973 |
+
// Show ssba image.
|
1974 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/tumblr.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="tumblr" class="ssba ssba-img" alt="Share on Tumblr" />';
|
1975 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
1976 |
+
// Show custom image.
|
1977 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_tumblr'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="tumblr" class="ssba ssba-img" alt="share on Tumblr" />';
|
1978 |
+
}
|
1979 |
+
|
1980 |
+
// Close href.
|
1981 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
1982 |
+
|
1983 |
+
// Close href.
|
1984 |
+
$html_share_buttons .= '</a>';
|
1985 |
+
|
1986 |
+
// If show share count is set to Y.
|
1987 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
1988 |
+
||
|
1989 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
1990 |
+
||
|
1991 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
1992 |
+
)
|
1993 |
+
&& $boo_show_share_count
|
1994 |
+
) ) {
|
1995 |
+
$html_share_buttons .= '<span class="' . $count_class . '">' . esc_html( $this->get_tumblr_share_count( $url_current_page ) ) . '</span>';
|
1996 |
+
}
|
1997 |
+
|
1998 |
+
// Add closing li if plus.
|
1999 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2000 |
+
$html_share_buttons .= '</li>';
|
2001 |
+
}
|
2002 |
+
|
2003 |
+
// Return share buttons.
|
2004 |
+
return $html_share_buttons;
|
2005 |
+
}
|
2006 |
+
|
2007 |
+
/**
|
2008 |
+
* Get tumblr share count.
|
2009 |
+
*
|
2010 |
+
* @param string $url_current_page The current url.
|
2011 |
+
*
|
2012 |
+
* @return int|string
|
2013 |
+
*/
|
2014 |
+
public function get_tumblr_share_count( $url_current_page ) {
|
2015 |
+
// Get results from tumblr and return the number of shares.
|
2016 |
+
$result = wp_safe_remote_get(
|
2017 |
+
'http://api.tumblr.com/v2/share/stats?url=' . $url_current_page,
|
2018 |
+
array(
|
2019 |
+
'timeout' => 6,
|
2020 |
+
)
|
2021 |
+
);
|
2022 |
+
|
2023 |
+
// Check there was an error.
|
2024 |
+
if ( is_wp_error( $result ) ) {
|
2025 |
+
return 0;
|
2026 |
+
}
|
2027 |
+
|
2028 |
+
// Decode data.
|
2029 |
+
$array = json_decode( $result['body'], true );
|
2030 |
+
$count = isset( $array['response']['note_count'] ) ? $array['response']['note_count'] : 0;
|
2031 |
+
|
2032 |
+
return ( $count ) ? $count : '0';
|
2033 |
+
}
|
2034 |
+
|
2035 |
+
/**
|
2036 |
+
* Get print button.
|
2037 |
+
*
|
2038 |
+
* @param array $arr_settings The current ssba settings.
|
2039 |
+
* @param string $url_current_page The current page url.
|
2040 |
+
* @param string $str_page_title The page title.
|
2041 |
+
* @param bool $boo_show_share_count Show share count or not.
|
2042 |
+
*
|
2043 |
+
* @return string
|
2044 |
+
*/
|
2045 |
+
public function ssba_print( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
2046 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-print ssbp-btn' : '';
|
2047 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
2048 |
+
$network = 'Print';
|
2049 |
+
$html_share_buttons = '';
|
2050 |
+
|
2051 |
+
// Add li if plus.
|
2052 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2053 |
+
$html_share_buttons .= '<li class="ssbp-li--print">';
|
2054 |
+
}
|
2055 |
+
|
2056 |
+
$html_share_buttons .= '<a data-site="print" class="ssba_print ssba_share_link ' . esc_attr( $plus_class ) . '" href="#" onclick="window.print()">';
|
2057 |
+
|
2058 |
+
// If image set is not custom.
|
2059 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
2060 |
+
// Show ssba image.
|
2061 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/print.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Print" class="ssba ssba-img" alt="Print this page" />';
|
2062 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
2063 |
+
// Show custom image.
|
2064 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_print'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Print" class="ssba ssba-img" alt="Print this page" />';
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
// Close href.
|
2068 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
2069 |
+
|
2070 |
+
// Close href.
|
2071 |
+
$html_share_buttons .= '</a>';
|
2072 |
+
|
2073 |
+
// Add closing li if plus.
|
2074 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2075 |
+
$html_share_buttons .= '</li>';
|
2076 |
+
}
|
2077 |
+
|
2078 |
+
// Return share buttons.
|
2079 |
+
return $html_share_buttons;
|
2080 |
+
}
|
2081 |
+
|
2082 |
+
/**
|
2083 |
+
* Get vk button.
|
2084 |
+
*
|
2085 |
+
* @param array $arr_settings The current ssba settings.
|
2086 |
+
* @param string $url_current_page The current page url.
|
2087 |
+
* @param string $str_page_title The page title.
|
2088 |
+
* @param bool $boo_show_share_count Show share count or not.
|
2089 |
+
*
|
2090 |
+
* @return string
|
2091 |
+
*/
|
2092 |
+
public function ssba_vk( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
2093 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
2094 |
+
$network = 'VK';
|
2095 |
+
$target =
|
2096 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
2097 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
2098 |
+
&& ! isset(
|
2099 |
+
$arr_settings['bar_call']
|
2100 |
+
) )
|
2101 |
+
||
|
2102 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
2103 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
2104 |
+
&& ! isset(
|
2105 |
+
$arr_settings['bar_call']
|
2106 |
+
) )
|
2107 |
+
||
|
2108 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
2109 |
+
&& isset(
|
2110 |
+
$arr_settings['bar_call']
|
2111 |
+
) ) ? ' target="_blank" ' : '';
|
2112 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-vk ssbp-btn' : '';
|
2113 |
+
$html_share_buttons = '';
|
2114 |
+
|
2115 |
+
// Add li if plus.
|
2116 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2117 |
+
$html_share_buttons .= '<li class="ssbp-li--vk">';
|
2118 |
+
}
|
2119 |
+
|
2120 |
+
// Vk share link.
|
2121 |
+
$html_share_buttons .= '<a data-site="vk" class="ssba_vk_share ssba_share_link' . esc_attr( $plus_class ) . '" href="http://vkontakte.ru/share.php?url=' . esc_attr( $url_current_page ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
2122 |
+
|
2123 |
+
// If image set is not custom.
|
2124 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
2125 |
+
// Show ssba image.
|
2126 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/vk.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="VK" class="ssba ssba-img" alt="Share on VK" />';
|
2127 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
2128 |
+
// Show custom image.
|
2129 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_vk'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="VK" class="ssba ssba-img" alt="Share on VK" />';
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
// Close href.
|
2133 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
2134 |
+
|
2135 |
+
// Close href.
|
2136 |
+
$html_share_buttons .= '</a>';
|
2137 |
+
|
2138 |
+
// Add closing li if plus.
|
2139 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2140 |
+
$html_share_buttons .= '</li>';
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
// Return share buttons.
|
2144 |
+
return $html_share_buttons;
|
2145 |
+
}
|
2146 |
+
|
2147 |
+
/**
|
2148 |
+
* Get yummly button.
|
2149 |
+
*
|
2150 |
+
* @param array $arr_settings The current ssba settings.
|
2151 |
+
* @param string $url_current_page The current page url.
|
2152 |
+
* @param string $str_page_title The page title.
|
2153 |
+
* @param bool $boo_show_share_count Show share count or not.
|
2154 |
+
*
|
2155 |
+
* @return string
|
2156 |
+
*/
|
2157 |
+
public function ssba_yummly( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
2158 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
2159 |
+
$network = 'Yummly';
|
2160 |
+
$target =
|
2161 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
2162 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
2163 |
+
&& ! isset(
|
2164 |
+
$arr_settings['bar_call']
|
2165 |
+
) )
|
2166 |
+
||
|
2167 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
2168 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
2169 |
+
&& ! isset(
|
2170 |
+
$arr_settings['bar_call']
|
2171 |
+
) )
|
2172 |
+
||
|
2173 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
2174 |
+
&& isset(
|
2175 |
+
$arr_settings['bar_call']
|
2176 |
+
) ) ? ' target="_blank" ' : '';
|
2177 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-yummly ssbp-btn' : '';
|
2178 |
+
$count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
|
2179 |
+
$html_share_buttons = '';
|
2180 |
+
|
2181 |
+
// Add li if plus.
|
2182 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2183 |
+
$html_share_buttons .= '<li class="ssbp-li--yummly">';
|
2184 |
+
}
|
2185 |
+
|
2186 |
+
// Yummly share link.
|
2187 |
+
$html_share_buttons .= '<a data-site="yummly" class="ssba_yummly_share ssba_share_link' . esc_attr( $plus_class ) . '" href="http://www.yummly.com/urb/verify?url=' . esc_attr( $url_current_page ) . '&title=' . esc_attr( rawurlencode( html_entity_decode( $str_page_title ) ) ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
2188 |
+
|
2189 |
+
// If image set is not custom.
|
2190 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
2191 |
+
// Show ssba image.
|
2192 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/yummly.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Yummly" class="ssba ssba-img" alt="Share on Yummly" />';
|
2193 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
2194 |
+
// Show custom image.
|
2195 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_yummly'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Yummly" class="ssba ssba-img" alt="Share on Yummly" />';
|
2196 |
+
}
|
2197 |
+
|
2198 |
+
// Close href.
|
2199 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
2200 |
+
|
2201 |
+
// Close href.
|
2202 |
+
$html_share_buttons .= '</a>';
|
2203 |
+
|
2204 |
+
// If show share count is set to Y.
|
2205 |
+
if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
|
2206 |
+
||
|
2207 |
+
( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
|
2208 |
+
||
|
2209 |
+
( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
|
2210 |
+
)
|
2211 |
+
&& $boo_show_share_count
|
2212 |
+
) ) {
|
2213 |
+
$html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->get_yummly_share_count( $url_current_page ) ) . '</span>';
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
// Add closing li if plus.
|
2217 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2218 |
+
$html_share_buttons .= '</li>';
|
2219 |
+
}
|
2220 |
+
|
2221 |
+
// Return share buttons.
|
2222 |
+
return $html_share_buttons;
|
2223 |
+
}
|
2224 |
+
|
2225 |
+
/**
|
2226 |
+
* Get yummly share count.
|
2227 |
+
*
|
2228 |
+
* @param string $url_current_page the current page url.
|
2229 |
+
*
|
2230 |
+
* @return int|string
|
2231 |
+
*/
|
2232 |
+
public function get_yummly_share_count( $url_current_page ) {
|
2233 |
+
// Get results from yummly and return the number of shares.
|
2234 |
+
$result = wp_safe_remote_get(
|
2235 |
+
'http://www.yummly.com/services/yum-count?url=' . $url_current_page,
|
2236 |
+
array(
|
2237 |
+
'timeout' => 6,
|
2238 |
+
)
|
2239 |
+
);
|
2240 |
+
|
2241 |
+
// Check there was an error.
|
2242 |
+
if ( is_wp_error( $result ) ) {
|
2243 |
+
return 0;
|
2244 |
+
}
|
2245 |
+
|
2246 |
+
// Decode data.
|
2247 |
+
$array = json_decode( $result['body'], true );
|
2248 |
+
$count = isset( $array['count'] ) ? $array['count'] : '0';
|
2249 |
+
|
2250 |
+
// Return.
|
2251 |
+
return $count;
|
2252 |
+
}
|
2253 |
+
|
2254 |
+
/**
|
2255 |
+
* Get whatsapp button.
|
2256 |
+
*
|
2257 |
+
* @param array $arr_settings The current ssba settings.
|
2258 |
+
* @param string $url_current_page The current page url.
|
2259 |
+
* @param string $str_page_title The page title.
|
2260 |
+
* @param bool $boo_show_share_count Show share count or not.
|
2261 |
+
*
|
2262 |
+
* @return string
|
2263 |
+
*/
|
2264 |
+
public function ssba_whatsapp( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
2265 |
+
if ( ! wp_is_mobile() ) {
|
2266 |
+
return;
|
2267 |
+
}
|
2268 |
+
|
2269 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
2270 |
+
$network = 'Whatsapp';
|
2271 |
+
$target =
|
2272 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
2273 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
2274 |
+
&& ! isset(
|
2275 |
+
$arr_settings['bar_call']
|
2276 |
+
) )
|
2277 |
+
||
|
2278 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
2279 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
2280 |
+
&& ! isset(
|
2281 |
+
$arr_settings['bar_call']
|
2282 |
+
) )
|
2283 |
+
||
|
2284 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
2285 |
+
&& isset(
|
2286 |
+
$arr_settings['bar_call']
|
2287 |
+
) ) ? ' target="_blank" ' : '';
|
2288 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-whatsapp ssbp-btn' : '';
|
2289 |
+
$html_share_buttons = '';
|
2290 |
+
|
2291 |
+
// Add li if plus.
|
2292 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2293 |
+
$html_share_buttons .= '<li class="ssbp-li--whatsapp">';
|
2294 |
+
}
|
2295 |
+
|
2296 |
+
// Whatsapp share link.
|
2297 |
+
$html_share_buttons .= '<a data-site="whatsapp" class="ssba_whatsapp_share ssba_share_link' . esc_attr( $plus_class ) . '" href="whatsapp://send?text=' . rawurlencode( $url_current_page . ' ' . $str_page_title ) . '" ' . esc_attr( $target . $nofollow ) . '>';
|
2298 |
+
|
2299 |
+
// If image set is not custom.
|
2300 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
2301 |
+
// Show ssba image.
|
2302 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/whatsapp.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Whatsapp" class="ssba ssba-img" alt="Share on Whatsapp" />';
|
2303 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
2304 |
+
// Show custom image.
|
2305 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_whatsapp'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Whatsapp" class="ssba ssba-img" alt="Share on Whatsapp" />';
|
2306 |
+
}
|
2307 |
+
|
2308 |
+
// Close href.
|
2309 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
2310 |
+
|
2311 |
+
// Close href.
|
2312 |
+
$html_share_buttons .= '</a>';
|
2313 |
+
|
2314 |
+
// Add closing li if plus.
|
2315 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2316 |
+
$html_share_buttons .= '</li>';
|
2317 |
+
}
|
2318 |
+
|
2319 |
+
// Return share buttons.
|
2320 |
+
return $html_share_buttons;
|
2321 |
+
}
|
2322 |
+
|
2323 |
+
/**
|
2324 |
+
* Get xing button.
|
2325 |
+
*
|
2326 |
+
* @param array $arr_settings The current ssba settings.
|
2327 |
+
* @param string $url_current_page The current page url.
|
2328 |
+
* @param string $str_page_title The page title.
|
2329 |
+
* @param bool $boo_show_share_count Show share count or not.
|
2330 |
+
*
|
2331 |
+
* @return string
|
2332 |
+
*/
|
2333 |
+
public function ssba_xing( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
|
2334 |
+
$nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
|
2335 |
+
$network = 'Xing';
|
2336 |
+
$target =
|
2337 |
+
( 'Y' === $arr_settings['ssba_plus_share_new_window']
|
2338 |
+
&& 'Y' === $arr_settings['ssba_new_buttons']
|
2339 |
+
&& ! isset(
|
2340 |
+
$arr_settings['bar_call']
|
2341 |
+
) )
|
2342 |
+
||
|
2343 |
+
( 'Y' === $arr_settings['ssba_share_new_window']
|
2344 |
+
&& 'Y' !== $arr_settings['ssba_new_buttons']
|
2345 |
+
&& ! isset(
|
2346 |
+
$arr_settings['bar_call']
|
2347 |
+
) )
|
2348 |
+
||
|
2349 |
+
( 'Y' === $arr_settings['ssba_bar_share_new_window']
|
2350 |
+
&& isset(
|
2351 |
+
$arr_settings['bar_call']
|
2352 |
+
) ) ? ' target="_blank" ' : '';
|
2353 |
+
$plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-xing ssbp-btn' : '';
|
2354 |
+
$html_share_buttons = '';
|
2355 |
+
|
2356 |
+
// Add li if plus.
|
2357 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2358 |
+
$html_share_buttons .= '<li class="ssbp-li--xing">';
|
2359 |
+
}
|
2360 |
+
|
2361 |
+
// Xing share link.
|
2362 |
+
$html_share_buttons .= '<a data-site="xing" class="ssba_xing_share ssba_share_link' . esc_attr( $plus_class ) . '" href="https://www.xing.com/spi/shares/new?url=' . $url_current_page . '" ' . esc_attr( $target . $nofollow ) . '>';
|
2363 |
+
|
2364 |
+
// If image set is not custom.
|
2365 |
+
if ( 'custom' !== $arr_settings['ssba_image_set'] && 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) {
|
2366 |
+
// Show ssba image.
|
2367 |
+
$html_share_buttons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/xing.png" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Xing" class="ssba ssba-img" alt="Share on Xing" />';
|
2368 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] && ! isset( $arr_settings['bar_call'] ) ) { // If using custom images.
|
2369 |
+
// Show custom image.
|
2370 |
+
$html_share_buttons .= '<img src="' . esc_url( $arr_settings['ssba_custom_xing'] ) . '" style="width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px;" title="Xing" class="ssba ssba-img" alt="Share on Xing" />';
|
2371 |
+
}
|
2372 |
+
|
2373 |
+
// Close href.
|
2374 |
+
$html_share_buttons .= '<div title="' . $network . '" class="ssbp-text">' . $network . '</div>';
|
2375 |
+
|
2376 |
+
// Close href.
|
2377 |
+
$html_share_buttons .= '</a>';
|
2378 |
+
|
2379 |
+
// Add closing li if plus.
|
2380 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
|
2381 |
+
$html_share_buttons .= '</li>';
|
2382 |
+
}
|
2383 |
+
|
2384 |
+
// Return share buttons.
|
2385 |
+
return $html_share_buttons;
|
2386 |
+
}
|
2387 |
}
|
php/class-database.php
CHANGED
@@ -12,696 +12,684 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Database
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
// Set variable.
|
697 |
-
$arr_settings = array();
|
698 |
-
|
699 |
-
foreach ($wp_registered_settings as $name => $value) {
|
700 |
-
if (in_array('ssba', explode('_', $name), true)) {
|
701 |
-
$arr_settings[$name] = $value;
|
702 |
-
}
|
703 |
-
}
|
704 |
-
|
705 |
-
return $arr_settings;
|
706 |
-
}
|
707 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Database {
|
16 |
+
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Plugin instance.
|
20 |
+
*
|
21 |
+
* @var object
|
22 |
+
*/
|
23 |
+
public $plugin;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Simple Share Buttons Adder instance.
|
27 |
+
*
|
28 |
+
* @var object
|
29 |
+
*/
|
30 |
+
public $class_ssba;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Class constructor.
|
34 |
+
*
|
35 |
+
* @param object $plugin Plugin class.
|
36 |
+
* @param object $class_ssba Simple Share Buttons Adder class.
|
37 |
+
*/
|
38 |
+
public function __construct( $plugin, $class_ssba ) {
|
39 |
+
$this->plugin = $plugin;
|
40 |
+
$this->class_ssba = $class_ssba;
|
41 |
+
|
42 |
+
// Run the activation function upon activation of the plugin.
|
43 |
+
register_activation_hook( $this->plugin->dir_path . '/simple-share-buttons-adder.php', array( $this, 'activate' ) );
|
44 |
+
|
45 |
+
// Register deactivation hook.
|
46 |
+
register_deactivation_hook( $this->plugin->dir_path . '/simple-share-buttons-adder.php', array( $this, 'deactivate' ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Add any settings default if it doesn't exist already.
|
51 |
+
*
|
52 |
+
* @param bool $return_array Whether to return the default setting array or not.
|
53 |
+
*
|
54 |
+
* @action admin_init
|
55 |
+
*/
|
56 |
+
public function get_setting_array( $return_array = false ) {
|
57 |
+
// Array ready with defaults.
|
58 |
+
$ssba_settings = array(
|
59 |
+
'ssba_omit_pages' => '',
|
60 |
+
'ssba_omit_pages_plus' => '',
|
61 |
+
'ssba_omit_pages_bar' => '',
|
62 |
+
'ssba_image_set' => 'somacro',
|
63 |
+
'ssba_size' => '35',
|
64 |
+
'ssba_pages' => '',
|
65 |
+
'ssba_posts' => '',
|
66 |
+
'ssba_cats_archs' => '',
|
67 |
+
'ssba_homepage' => '',
|
68 |
+
'ssba_excerpts' => '',
|
69 |
+
'ssba_plus_pages' => '',
|
70 |
+
'ssba_plus_posts' => '',
|
71 |
+
'ssba_plus_cats_archs' => '',
|
72 |
+
'ssba_plus_homepage' => '',
|
73 |
+
'ssba_plus_excerpts' => '',
|
74 |
+
'ssba_bar_pages' => '',
|
75 |
+
'ssba_bar_posts' => '',
|
76 |
+
'ssba_bar_cats_archs' => '',
|
77 |
+
'ssba_bar_homepage' => '',
|
78 |
+
'ssba_bar_excerpts' => '',
|
79 |
+
'ssba_align' => 'left',
|
80 |
+
'ssba_plus_align' => 'center',
|
81 |
+
'ssba_bar_align' => 'left',
|
82 |
+
'ssba_padding' => '6',
|
83 |
+
'ssba_before_or_after' => 'after',
|
84 |
+
'ssba_before_or_after_plus' => 'after',
|
85 |
+
'ssba_additional_css' => '',
|
86 |
+
'ssba_custom_styles' => '',
|
87 |
+
'ssba_custom_styles_enabled' => '',
|
88 |
+
'ssba_plus_additional_css' => '',
|
89 |
+
'ssba_plus_custom_styles' => '',
|
90 |
+
'ssba_plus_custom_styles_enabled' => '',
|
91 |
+
'ssba_bar_additional_css' => '',
|
92 |
+
'ssba_bar_custom_styles' => '',
|
93 |
+
'ssba_bar_custom_styles_enabled' => '',
|
94 |
+
'ssba_email_message' => '',
|
95 |
+
'ssba_twitter_text' => '',
|
96 |
+
'ssba_buffer_text' => '',
|
97 |
+
'ssba_flattr_user_id' => '',
|
98 |
+
'ssba_flattr_url' => '',
|
99 |
+
'ssba_bar_share_new_window' => 'Y',
|
100 |
+
'ssba_share_new_window' => 'Y',
|
101 |
+
'ssba_plus_share_new_window' => 'Y',
|
102 |
+
'ssba_link_to_ssb' => 'N',
|
103 |
+
'ssba_show_share_count' => '',
|
104 |
+
'ssba_plus_show_share_count' => '',
|
105 |
+
'ssba_bar_show_share_count' => '',
|
106 |
+
'ssba_share_count_style' => 'default',
|
107 |
+
'ssba_share_count_css' => '',
|
108 |
+
'ssba_share_count_once' => 'Y',
|
109 |
+
'ssba_plus_share_count_style' => 'default',
|
110 |
+
'ssba_plus_share_count_css' => '',
|
111 |
+
'ssba_plus_share_count_once' => 'Y',
|
112 |
+
'ssba_bar_share_count_style' => 'default',
|
113 |
+
'ssba_bar_share_count_css' => '',
|
114 |
+
'ssba_bar_share_count_once' => 'Y',
|
115 |
+
'ssba_widget_text' => '',
|
116 |
+
'ssba_rel_nofollow' => '',
|
117 |
+
'ssba_default_pinterest' => '',
|
118 |
+
'ssba_pinterest_featured' => '',
|
119 |
+
'ssba_plus_widget_text' => '',
|
120 |
+
'ssba_plus_rel_nofollow' => '',
|
121 |
+
'ssba_plus_default_pinterest' => '',
|
122 |
+
'ssba_plus_pinterest_featured' => '',
|
123 |
+
'ssba_bar_widget_text' => '',
|
124 |
+
'ssba_bar_rel_nofollow' => '',
|
125 |
+
'ssba_bar_default_pinterest' => '',
|
126 |
+
'ssba_bar_pinterest_featured' => '',
|
127 |
+
'ssba_content_priority' => '10',
|
128 |
+
|
129 |
+
// Share container.
|
130 |
+
'ssba_div_padding' => '',
|
131 |
+
'ssba_div_rounded_corners' => '',
|
132 |
+
'ssba_border_width' => '',
|
133 |
+
'ssba_div_border' => '',
|
134 |
+
'ssba_div_background' => '',
|
135 |
+
|
136 |
+
// Share text.
|
137 |
+
'ssba_share_text' => esc_html__( 'Share this...', 'simple-share-buttons-adder' ),
|
138 |
+
'ssba_text_placement' => 'above',
|
139 |
+
'ssba_font_family' => '',
|
140 |
+
'ssba_font_color' => '',
|
141 |
+
'ssba_font_size' => '12',
|
142 |
+
'ssba_font_weight' => '',
|
143 |
+
'ssba_plus_share_text' => esc_html__( 'Share this...', 'simple-share-buttons-adder' ),
|
144 |
+
'ssba_plus_text_placement' => 'above',
|
145 |
+
'ssba_plus_font_family' => '',
|
146 |
+
'ssba_plus_font_color' => '',
|
147 |
+
'ssba_plus_font_size' => '12',
|
148 |
+
'ssba_plus_font_weight' => '',
|
149 |
+
|
150 |
+
// Include.
|
151 |
+
'ssba_selected_buttons' => 'facebook,pinterest,twitter,linkedin',
|
152 |
+
'ssba_selected_bar_buttons' => 'facebook,pinterest,twitter,linkedin',
|
153 |
+
'ssba_selected_plus_buttons' => 'facebook,pinterest,twitter,linkedin',
|
154 |
+
'ssba_plus_button_style' => 1,
|
155 |
+
'ssba_bar_style' => 1,
|
156 |
+
'ssba_new_buttons' => '',
|
157 |
+
'ssba_bar_enabled' => '',
|
158 |
+
'ssba_bar_position' => 'left',
|
159 |
+
'ssba_plus_height' => '48',
|
160 |
+
'ssba_plus_width' => '48',
|
161 |
+
'ssba_plus_margin' => '12',
|
162 |
+
'ssba_plus_button_color' => '',
|
163 |
+
'ssba_plus_button_hover_color' => '',
|
164 |
+
'ssba_plus_icon_size' => '',
|
165 |
+
'ssba_plus_icon_color' => '',
|
166 |
+
'ssba_plus_icon_hover_color' => '',
|
167 |
+
'ssba_bar_height' => '48',
|
168 |
+
'ssba_bar_width' => '48',
|
169 |
+
'ssba_bar_margin' => '0',
|
170 |
+
'ssba_bar_icon_size' => '',
|
171 |
+
'ssba_bar_button_color' => '',
|
172 |
+
'ssba_bar_button_hover_color' => '',
|
173 |
+
'ssba_bar_icon_color' => '',
|
174 |
+
'ssba_bar_icon_hover_color' => '',
|
175 |
+
'ssba_bar_desktop' => 'Y',
|
176 |
+
'ssba_bar_mobile' => 'Y',
|
177 |
+
'ssba_mobile_breakpoint' => '',
|
178 |
+
|
179 |
+
// Custom images.
|
180 |
+
'ssba_custom_email' => '',
|
181 |
+
'ssba_custom_facebook' => '',
|
182 |
+
'ssba_custom_flipboard' => '',
|
183 |
+
'ssba_custom_twitter' => '',
|
184 |
+
'ssba_custom_diggit' => '',
|
185 |
+
'ssba_custom_line' => '',
|
186 |
+
'ssba_custom_weibo' => '',
|
187 |
+
'ssba_custom_linkedin' => '',
|
188 |
+
'ssba_custom_pinterest' => '',
|
189 |
+
'ssba_custom_print' => '',
|
190 |
+
'ssba_custom_reddit' => '',
|
191 |
+
'ssba_custom_skype' => '',
|
192 |
+
'ssba_custom_snapchat' => '',
|
193 |
+
'ssba_custom_stumbleupon' => '',
|
194 |
+
'ssba_custom_buffer' => '',
|
195 |
+
'ssba_custom_flattr' => '',
|
196 |
+
'ssba_custom_telegram' => '',
|
197 |
+
'ssba_custom_tumblr' => '',
|
198 |
+
'ssba_custom_vk' => '',
|
199 |
+
'ssba_custom_yummly' => '',
|
200 |
+
|
201 |
+
// Sharedcount.
|
202 |
+
'sharedcount_enabled' => '',
|
203 |
+
'sharedcount_api_key' => '',
|
204 |
+
'sharedcount_plan' => 'free',
|
205 |
+
'sharedcount_plus_enabled' => '',
|
206 |
+
'sharedcount_plus_api_key' => '',
|
207 |
+
'sharedcount_plus_plan' => 'free',
|
208 |
+
'sharedcount_share_enabled' => '',
|
209 |
+
'sharedcount_share_api_key' => '',
|
210 |
+
'sharedcount_share_plan' => 'free',
|
211 |
+
|
212 |
+
// New with sharethis.
|
213 |
+
'facebook_insights' => '',
|
214 |
+
'facebook_app_id' => '',
|
215 |
+
'ignore_facebook_sdk' => '',
|
216 |
+
'plus_facebook_insights' => '',
|
217 |
+
'plus_facebook_app_id' => '',
|
218 |
+
'plus_ignore_facebook_sdk' => '',
|
219 |
+
'share_facebook_insights' => '',
|
220 |
+
'share_facebook_app_id' => '',
|
221 |
+
'accepted_sharethis_terms' => 'N',
|
222 |
+
);
|
223 |
+
|
224 |
+
if ( $return_array ) {
|
225 |
+
return $ssba_settings;
|
226 |
+
}
|
227 |
+
|
228 |
+
// The current setting if any.
|
229 |
+
$current_settings = get_option( 'ssba_settings', true );
|
230 |
+
$current_settings = is_array( $current_settings ) && null !== $current_settings && false !== $current_settings ? $current_settings : array();
|
231 |
+
|
232 |
+
foreach ( $ssba_settings as $setting_name => $value ) {
|
233 |
+
if ( ! isset( $current_settings[ $setting_name ] ) ) {
|
234 |
+
$current_settings[ $setting_name ] = $value;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
update_option( 'ssba_settings', $current_settings );
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Activate ssba function.
|
243 |
+
*/
|
244 |
+
public function activate() {
|
245 |
+
// Likely a reactivation, return doing nothing.
|
246 |
+
if ( false !== get_option( 'ssba_version' ) ) {
|
247 |
+
return;
|
248 |
+
}
|
249 |
+
|
250 |
+
$ssba_settings = $this->get_setting_array( true );
|
251 |
+
|
252 |
+
// Insert default options for ssba.
|
253 |
+
update_option( 'ssba_settings', $ssba_settings );
|
254 |
+
|
255 |
+
// Button helper array.
|
256 |
+
$this->ssba_button_helper_array();
|
257 |
+
|
258 |
+
// Ssba version.
|
259 |
+
add_option( 'ssba_version', SSBA_VERSION );
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Deactivate ssba.
|
264 |
+
*/
|
265 |
+
public function deactivate() {
|
266 |
+
// Delete options.
|
267 |
+
delete_option( 'ssba_settings' );
|
268 |
+
delete_option( 'ssba_version' );
|
269 |
+
delete_option( 'ssba_property_id' );
|
270 |
+
delete_option( 'ssba_token' );
|
271 |
+
delete_option( 'ssba_buttons' );
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* The upgrade function.
|
276 |
+
*
|
277 |
+
* @param array $arr_settings The current ssba settings.
|
278 |
+
* @param string $version The current plugin version.
|
279 |
+
*/
|
280 |
+
public function upgrade_ssba( $arr_settings, $version ) {
|
281 |
+
// If version is less than 7.4.10.
|
282 |
+
if ( $version < '7.7.21' ) {
|
283 |
+
$this->ssba_button_helper_array();
|
284 |
+
}
|
285 |
+
|
286 |
+
// If version is less than 7.4.10.
|
287 |
+
if ( $version < '7.4.10' ) {
|
288 |
+
$new_settings = array(
|
289 |
+
'ssba_plus_align' => 'left',
|
290 |
+
'ssba_bar_align' => 'left',
|
291 |
+
'ssba_before_or_after_plus' => 'after',
|
292 |
+
'ssba_share_new_window' => 'Y',
|
293 |
+
'ssba_plus_share_text' => esc_html__( 'Share this...', 'simple-share-buttons-adder' ),
|
294 |
+
'ssba_plus_text_placement' => 'above',
|
295 |
+
'ssba_plus_font_family' => '',
|
296 |
+
'ssba_plus_font_color' => '',
|
297 |
+
'ssba_plus_font_size' => '12',
|
298 |
+
'ssba_plus_font_weight' => '',
|
299 |
+
'ssba_selected_bar_buttons' => 'facebook,pinterest,twitter,linkedin',
|
300 |
+
'ssba_selected_plus_buttons' => 'facebook,pinterest,twitter,linkedin',
|
301 |
+
'ssba_plus_button_style' => 1,
|
302 |
+
'ssba_bar_style' => 1,
|
303 |
+
'ssba_new_buttons' => '',
|
304 |
+
'ssba_bar_enabled' => '',
|
305 |
+
'ssba_bar_position' => 'left',
|
306 |
+
'ssba_plus_height' => '48',
|
307 |
+
'ssba_plus_width' => '48',
|
308 |
+
'ssba_plus_margin' => '12',
|
309 |
+
'ssba_plus_button_color' => '',
|
310 |
+
'ssba_plus_button_hover_color' => '',
|
311 |
+
'ssba_plus_icon_size' => '',
|
312 |
+
'ssba_plus_icon_color' => '',
|
313 |
+
'ssba_plus_icon_hover_color' => '',
|
314 |
+
'ssba_bar_height' => '48',
|
315 |
+
'ssba_bar_width' => '48',
|
316 |
+
'ssba_bar_margin' => '0',
|
317 |
+
'ssba_bar_icon_size' => '',
|
318 |
+
'ssba_bar_button_color' => '',
|
319 |
+
'ssba_bar_button_hover_color' => '',
|
320 |
+
'ssba_bar_icon_color' => '',
|
321 |
+
'ssba_bar_icon_hover_color' => '',
|
322 |
+
'ssba_bar_desktop' => 'Y',
|
323 |
+
'ssba_bar_mobile' => 'Y',
|
324 |
+
'ssba_mobile_breakpoint' => '',
|
325 |
+
'ssba_bar_show_share_count' => '',
|
326 |
+
);
|
327 |
+
|
328 |
+
$current_settings = get_option( 'ssba_settings', true );
|
329 |
+
$new_array = $new_settings + $current_settings;
|
330 |
+
|
331 |
+
update_option( 'ssba_settings', $new_array );
|
332 |
+
|
333 |
+
// Ssba version.
|
334 |
+
update_option( 'ssba_version', SSBA_VERSION );
|
335 |
+
}
|
336 |
+
|
337 |
+
// If version is less than 6.0.5.
|
338 |
+
if ( $version < '6.0.5' ) {
|
339 |
+
// Ensure excerpts are set.
|
340 |
+
add_option( 'ssba_excerpts', '' );
|
341 |
+
|
342 |
+
// Add print button.
|
343 |
+
add_option( 'ssba_custom_print', '' );
|
344 |
+
|
345 |
+
// New for 3.8.
|
346 |
+
add_option( 'ssba_widget_text', '' );
|
347 |
+
add_option( 'ssba_rel_nofollow', '' );
|
348 |
+
|
349 |
+
// Added pre 4.5, added in 4.6 to fix notice.
|
350 |
+
add_option( 'ssba_rel_nofollow', '' );
|
351 |
+
|
352 |
+
// Added in 5.0.
|
353 |
+
add_option( 'ssba_custom_vk', '' );
|
354 |
+
add_option( 'ssba_custom_yummly', '' );
|
355 |
+
|
356 |
+
// Added in 5.2.
|
357 |
+
add_option( 'ssba_default_pinterest', '' );
|
358 |
+
|
359 |
+
// Added in 5.5.
|
360 |
+
add_option( 'ssba_pinterest_featured', '' );
|
361 |
+
|
362 |
+
// Added in 5.7. Additional CSS field.
|
363 |
+
add_option( 'ssba_additional_css', '' );
|
364 |
+
|
365 |
+
// Empty custom CSS var and option.
|
366 |
+
$custom_css = '';
|
367 |
+
|
368 |
+
add_option( 'ssba_custom_styles_enabled', '' );
|
369 |
+
|
370 |
+
// If some custom styles are in place.
|
371 |
+
if ( '' !== $arr_settings['ssba_custom_styles'] ) {
|
372 |
+
$custom_css .= $arr_settings['ssba_custom_styles'];
|
373 |
+
|
374 |
+
update_option( 'ssba_custom_styles_enabled', 'Y' );
|
375 |
+
}
|
376 |
+
|
377 |
+
// If some custom share count styles are in place.
|
378 |
+
if ( '' !== $arr_settings['ssba_bar_count_css'] ) {
|
379 |
+
$custom_css .= $arr_settings['ssba_bar_count_css'];
|
380 |
+
|
381 |
+
update_option( 'ssba_custom_styles_enabled', 'Y' );
|
382 |
+
}
|
383 |
+
|
384 |
+
// Update custom CSS option.
|
385 |
+
update_option( 'ssba_custom_styles', $custom_css );
|
386 |
+
|
387 |
+
// Content priority.
|
388 |
+
add_option( 'ssba_content_priority', '10' );
|
389 |
+
}
|
390 |
+
|
391 |
+
// If version is less than 6.0.6.
|
392 |
+
if ( $version < '6.0.6' ) {
|
393 |
+
// Get old settings.
|
394 |
+
$old_settings = $this->get_old_ssba_settings();
|
395 |
+
|
396 |
+
// Json encode old settings.
|
397 |
+
$json_settings = $old_settings;
|
398 |
+
|
399 |
+
// Insert all options for ssba as json.
|
400 |
+
add_option( 'ssba_settings', $json_settings );
|
401 |
+
|
402 |
+
// Delete old options.
|
403 |
+
$this->ssba_delete_old_options();
|
404 |
+
}
|
405 |
+
|
406 |
+
// If version is less than 6.1.3.
|
407 |
+
if ( $version < '6.1.3' ) {
|
408 |
+
// New settings.
|
409 |
+
$new = array(
|
410 |
+
'sharedcount_enabled' => '',
|
411 |
+
'sharedcount_api_key' => '',
|
412 |
+
'sharedcount_plan' => 'free',
|
413 |
+
);
|
414 |
+
|
415 |
+
// Update settings.
|
416 |
+
$this->class_ssba->ssba_update_options( $new );
|
417 |
+
}
|
418 |
+
|
419 |
+
// If version is less than 6.2.0.
|
420 |
+
if ( $version < '6.2.0' ) {
|
421 |
+
// New settings.
|
422 |
+
$new = array(
|
423 |
+
'facebook_insights' => '',
|
424 |
+
'facebook_app_id' => '',
|
425 |
+
'accepted_sharethis_terms' => '',
|
426 |
+
);
|
427 |
+
|
428 |
+
// Update settings.
|
429 |
+
$this->class_ssba->ssba_update_options( $new );
|
430 |
+
}
|
431 |
+
|
432 |
+
// Button helper array.
|
433 |
+
$this->ssba_button_helper_array();
|
434 |
+
|
435 |
+
// Update version number.
|
436 |
+
update_option( 'ssba_version', SSBA_VERSION );
|
437 |
+
}
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Button helper option.
|
441 |
+
*/
|
442 |
+
public function ssba_button_helper_array() {
|
443 |
+
$buttons = array(
|
444 |
+
'buffer' => array(
|
445 |
+
'full_name' => esc_html__( 'Buffer', 'simple-share-buttons-adder' ),
|
446 |
+
),
|
447 |
+
'diggit' => array(
|
448 |
+
'full_name' => esc_html__( 'Diggit', 'simple-share-buttons-adder' ),
|
449 |
+
),
|
450 |
+
'line' => array(
|
451 |
+
'full_name' => esc_html__( 'Line', 'simple-share-buttons-adder' ),
|
452 |
+
),
|
453 |
+
'skype' => array(
|
454 |
+
'full_name' => esc_html__( 'Skype', 'simple-share-buttons-adder' ),
|
455 |
+
),
|
456 |
+
'weibo' => array(
|
457 |
+
'full_name' => esc_html__( 'Weibo', 'simple-share-buttons-adder' ),
|
458 |
+
),
|
459 |
+
'email' => array(
|
460 |
+
'full_name' => esc_html__( 'Email', 'simple-share-buttons-adder' ),
|
461 |
+
),
|
462 |
+
'facebook' => array(
|
463 |
+
'full_name' => esc_html__( 'Facebook', 'simple-share-buttons-adder' ),
|
464 |
+
),
|
465 |
+
'flattr' => array(
|
466 |
+
'full_name' => esc_html__( 'Flattr', 'simple-share-buttons-adder' ),
|
467 |
+
),
|
468 |
+
'flipboard' => array(
|
469 |
+
'full_name' => esc_html__( 'Flipboard', 'simple-share-buttons-adder' ),
|
470 |
+
),
|
471 |
+
'linkedin' => array(
|
472 |
+
'full_name' => esc_html__( 'LinkedIn', 'simple-share-buttons-adder' ),
|
473 |
+
),
|
474 |
+
'pinterest' => array(
|
475 |
+
'full_name' => esc_html__( 'Pinterest', 'simple-share-buttons-adder' ),
|
476 |
+
),
|
477 |
+
'print' => array(
|
478 |
+
'full_name' => esc_html__( 'Print', 'simple-share-buttons-adder' ),
|
479 |
+
),
|
480 |
+
'reddit' => array(
|
481 |
+
'full_name' => esc_html__( 'Reddit', 'simple-share-buttons-adder' ),
|
482 |
+
),
|
483 |
+
'snapchat' => array(
|
484 |
+
'full_name' => esc_html__( 'Snapchat', 'simple-share-buttons-adder' ),
|
485 |
+
),
|
486 |
+
'stumbleupon' => array(
|
487 |
+
'full_name' => esc_html__( 'StumbleUpon', 'simple-share-buttons-adder' ),
|
488 |
+
),
|
489 |
+
'telegram' => array(
|
490 |
+
'full_name' => esc_html__( 'Telegram', 'simple-share-buttons-adder' ),
|
491 |
+
),
|
492 |
+
'tumblr' => array(
|
493 |
+
'full_name' => esc_html__( 'Tumblr', 'simple-share-buttons-adder' ),
|
494 |
+
),
|
495 |
+
'twitter' => array(
|
496 |
+
'full_name' => esc_html__( 'Twitter', 'simple-share-buttons-adder' ),
|
497 |
+
),
|
498 |
+
'vk' => array(
|
499 |
+
'full_name' => esc_html__( 'VK', 'simple-share-buttons-adder' ),
|
500 |
+
),
|
501 |
+
'whatsapp' => array(
|
502 |
+
'full_name' => esc_html__( 'WhatsApp', 'simple-share-buttons-adder' ),
|
503 |
+
),
|
504 |
+
'xing' => array(
|
505 |
+
'full_name' => esc_html__( 'Xing', 'simple-share-buttons-adder' ),
|
506 |
+
),
|
507 |
+
'yummly' => array(
|
508 |
+
'full_name' => esc_html__( 'Yummly', 'simple-share-buttons-adder' ),
|
509 |
+
),
|
510 |
+
);
|
511 |
+
|
512 |
+
// Helper array for ssbp.
|
513 |
+
update_option( 'ssba_buttons', $buttons );
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Delete old options to move to json array.
|
518 |
+
*/
|
519 |
+
public function ssba_delete_old_options() {
|
520 |
+
// Delete all options.
|
521 |
+
delete_option( 'ssba_version' );
|
522 |
+
delete_option( 'ssba_image_set' );
|
523 |
+
delete_option( 'ssba_size' );
|
524 |
+
delete_option( 'ssba_pages' );
|
525 |
+
delete_option( 'ssba_posts' );
|
526 |
+
delete_option( 'ssba_cats_archs' );
|
527 |
+
delete_option( 'ssba_homepage' );
|
528 |
+
delete_option( 'ssba_excerpts' );
|
529 |
+
delete_option( 'ssba_plus_pages' );
|
530 |
+
delete_option( 'ssba_plus_posts' );
|
531 |
+
delete_option( 'ssba_plus_cats_archs' );
|
532 |
+
delete_option( 'ssba_plus_homepage' );
|
533 |
+
delete_option( 'ssba_plus_excerpts' );
|
534 |
+
delete_option( 'ssba_omit_pages' );
|
535 |
+
delete_option( 'ssba_omit_pages_bar' );
|
536 |
+
delete_option( 'ssba_omit_pages_plus' );
|
537 |
+
delete_option( 'ssba_bar_enabled' );
|
538 |
+
delete_option( 'ssba_bar_pages' );
|
539 |
+
delete_option( 'ssba_bar_posts' );
|
540 |
+
delete_option( 'ssba_bar_cats_archs' );
|
541 |
+
delete_option( 'ssba_bar_homepage' );
|
542 |
+
delete_option( 'ssba_bar_excerpts' );
|
543 |
+
delete_option( 'ssba_align' );
|
544 |
+
delete_option( 'ssba_plus_align' );
|
545 |
+
delete_option( 'ssba_padding' );
|
546 |
+
delete_option( 'ssba_before_or_after' );
|
547 |
+
delete_option( 'ssba_before_or_after_plus' );
|
548 |
+
delete_option( 'ssba_additional_css' );
|
549 |
+
delete_option( 'ssba_custom_styles' );
|
550 |
+
delete_option( 'ssba_custom_styles_enabled' );
|
551 |
+
delete_option( 'ssba_email_message' );
|
552 |
+
delete_option( 'ssba_buffer_text' );
|
553 |
+
delete_option( 'ssba_twitter_text' );
|
554 |
+
delete_option( 'ssba_flattr_user_id' );
|
555 |
+
delete_option( 'ssba_flattr_url' );
|
556 |
+
delete_option( 'ssba_share_new_window' );
|
557 |
+
delete_option( 'ssba_link_to_ssb' );
|
558 |
+
delete_option( 'ssba_show_share_count' );
|
559 |
+
delete_option( 'ssba_bar_count_style' );
|
560 |
+
delete_option( 'ssba_bar_count_css' );
|
561 |
+
delete_option( 'ssba_bar_count_once' );
|
562 |
+
delete_option( 'ssba_widget_text' );
|
563 |
+
delete_option( 'ssba_rel_nofollow' );
|
564 |
+
delete_option( 'ssba_default_pinterest' );
|
565 |
+
delete_option( 'ssba_pinterest_featured' );
|
566 |
+
delete_option( 'ssba_content_priority' );
|
567 |
+
delete_option( 'ssba_plus_additional_css' );
|
568 |
+
delete_option( 'ssba_plus_custom_styles' );
|
569 |
+
delete_option( 'ssba_plus_custom_styles_enabled' );
|
570 |
+
delete_option( 'ssba_plus_email_message' );
|
571 |
+
delete_option( 'ssba_plus_buffer_text' );
|
572 |
+
delete_option( 'ssba_plus_twitter_text' );
|
573 |
+
delete_option( 'ssba_plus_flattr_user_id' );
|
574 |
+
delete_option( 'ssba_plus_flattr_url' );
|
575 |
+
delete_option( 'ssba_plus_share_new_window' );
|
576 |
+
delete_option( 'ssba_plus_link_to_ssb' );
|
577 |
+
delete_option( 'ssba_plus_show_share_count' );
|
578 |
+
delete_option( 'ssba_plus_share_count_style' );
|
579 |
+
delete_option( 'ssba_plus_share_count_css' );
|
580 |
+
delete_option( 'ssba_plus_share_count_once' );
|
581 |
+
delete_option( 'ssba_plus_widget_text' );
|
582 |
+
delete_option( 'ssba_plus_rel_nofollow' );
|
583 |
+
delete_option( 'ssba_plus_default_pinterest' );
|
584 |
+
delete_option( 'ssba_plus_pinterest_featured' );
|
585 |
+
delete_option( 'ssba_bar_additional_css' );
|
586 |
+
delete_option( 'ssba_bar_custom_styles' );
|
587 |
+
delete_option( 'ssba_bar_custom_styles_enabled' );
|
588 |
+
delete_option( 'ssba_bar_email_message' );
|
589 |
+
delete_option( 'ssba_bar_buffer_text' );
|
590 |
+
delete_option( 'ssba_bar_twitter_text' );
|
591 |
+
delete_option( 'ssba_bar_flattr_user_id' );
|
592 |
+
delete_option( 'ssba_bar_flattr_url' );
|
593 |
+
delete_option( 'ssba_bar_share_new_window' );
|
594 |
+
delete_option( 'ssba_bar_link_to_ssb' );
|
595 |
+
delete_option( 'ssba_bar_show_share_count' );
|
596 |
+
delete_option( 'ssba_bar_share_count_style' );
|
597 |
+
delete_option( 'ssba_bar_share_count_css' );
|
598 |
+
delete_option( 'ssba_bar_share_count_once' );
|
599 |
+
delete_option( 'ssba_bar_widget_text' );
|
600 |
+
delete_option( 'ssba_bar_rel_nofollow' );
|
601 |
+
delete_option( 'ssba_bar_default_pinterest' );
|
602 |
+
delete_option( 'ssba_bar_pinterest_featured' );
|
603 |
+
|
604 |
+
// Share container.
|
605 |
+
delete_option( 'ssba_div_padding' );
|
606 |
+
delete_option( 'ssba_div_rounded_corners' );
|
607 |
+
delete_option( 'ssba_border_width' );
|
608 |
+
delete_option( 'ssba_div_border' );
|
609 |
+
delete_option( 'ssba_div_background' );
|
610 |
+
|
611 |
+
// Share text.
|
612 |
+
delete_option( 'ssba_share_text' );
|
613 |
+
delete_option( 'ssba_text_placement' );
|
614 |
+
delete_option( 'ssba_font_family' );
|
615 |
+
delete_option( 'ssba_font_color' );
|
616 |
+
delete_option( 'ssba_font_size' );
|
617 |
+
delete_option( 'ssba_font_weight' );
|
618 |
+
delete_option( 'ssba_plus_share_text' );
|
619 |
+
delete_option( 'ssba_plus_text_placement' );
|
620 |
+
delete_option( 'ssba_plus_font_family' );
|
621 |
+
delete_option( 'ssba_plus_font_color' );
|
622 |
+
delete_option( 'ssba_plus_font_size' );
|
623 |
+
delete_option( 'ssba_plus_font_weight' );
|
624 |
+
|
625 |
+
// Include.
|
626 |
+
delete_option( 'ignore_facebook_sdk' );
|
627 |
+
delete_option( 'plus_ignore_facebook_sdk' );
|
628 |
+
delete_option( 'ssba_selected_buttons' );
|
629 |
+
delete_option( 'ssba_selected_share_buttons' );
|
630 |
+
delete_option( 'ssba_selected_plus_buttons' );
|
631 |
+
delete_option( 'ssba_bar_button_style' );
|
632 |
+
delete_option( 'ssba_bar_style' );
|
633 |
+
delete_option( 'ssba_new_buttons' );
|
634 |
+
delete_option( 'ssba_bar_position' );
|
635 |
+
delete_option( 'ssba_plus_height' );
|
636 |
+
delete_option( 'ssba_plus_width' );
|
637 |
+
delete_option( 'ssba_plus_margin' );
|
638 |
+
delete_option( 'ssba_plus_button_color' );
|
639 |
+
delete_option( 'ssba_plus_button_hover_color' );
|
640 |
+
delete_option( 'ssba_plus_icon_size' );
|
641 |
+
delete_option( 'ssba_plus_icon_color' );
|
642 |
+
delete_option( 'ssba_plus_icon_hover_color' );
|
643 |
+
delete_option( 'ssba_bar_height' );
|
644 |
+
delete_option( 'ssba_bar_width' );
|
645 |
+
delete_option( 'ssba_bar_margin' );
|
646 |
+
delete_option( 'ssba_bar_button_color' );
|
647 |
+
delete_option( 'ssba_bar_button_hover_color' );
|
648 |
+
delete_option( 'ssba_bar_icon_size' );
|
649 |
+
delete_option( 'ssba_bar_icon_color' );
|
650 |
+
delete_option( 'ssba_bar_icon_hover_color' );
|
651 |
+
delete_option( 'ssba_bar_desktop' );
|
652 |
+
delete_option( 'ssba_bar_mobile' );
|
653 |
+
delete_option( 'ssba_mobile_breakpoint' );
|
654 |
+
|
655 |
+
// Custom images.
|
656 |
+
delete_option( 'ssba_custom_email' );
|
657 |
+
delete_option( 'ssba_custom_google' );
|
658 |
+
delete_option( 'ssba_custom_facebook' );
|
659 |
+
delete_option( 'ssba_custom_twitter' );
|
660 |
+
delete_option( 'ssba_custom_diggit' );
|
661 |
+
delete_option( 'ssba_custom_linkedin' );
|
662 |
+
delete_option( 'ssba_custom_reddit' );
|
663 |
+
delete_option( 'ssba_custom_stumbleupon' );
|
664 |
+
delete_option( 'ssba_custom_pinterest' );
|
665 |
+
delete_option( 'ssba_custom_buffer' );
|
666 |
+
delete_option( 'ssba_custom_flattr' );
|
667 |
+
delete_option( 'ssba_custom_tumblr' );
|
668 |
+
delete_option( 'ssba_custom_print' );
|
669 |
+
delete_option( 'ssba_custom_vk' );
|
670 |
+
delete_option( 'ssba_custom_yummly' );
|
671 |
+
|
672 |
+
// Notice.
|
673 |
+
delete_option( 'ssba_dismiss_notice' );
|
674 |
+
}
|
675 |
+
|
676 |
+
/**
|
677 |
+
* Return old ssba settings (pre 6.0.6).
|
678 |
+
*
|
679 |
+
* @return array|null|object
|
680 |
+
*/
|
681 |
+
public function get_old_ssba_settings() {
|
682 |
+
global $wp_registered_settings;
|
683 |
+
|
684 |
+
// Set variable.
|
685 |
+
$arr_settings = array();
|
686 |
+
|
687 |
+
foreach ( $wp_registered_settings as $name => $value ) {
|
688 |
+
if ( in_array( 'ssba', explode( '_', $name ), true ) ) {
|
689 |
+
$arr_settings[ $name ] = $value;
|
690 |
+
}
|
691 |
+
}
|
692 |
+
|
693 |
+
return $arr_settings;
|
694 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
}
|
php/class-forms.php
CHANGED
@@ -12,256 +12,254 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Forms
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
<input type="checkbox" id="' . esc_attr($value['value']) . '" name="' . esc_attr($value['value']) . '" value="Y" ' . esc_attr($checked) . '>
|
155 |
</label>';
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
<
|
205 |
-
<input name="' . esc_attr($opts['name']) . '" id="' . esc_attr($opts['name']) . '" type="text" value="' . esc_attr($opts['value']) . '" class="form-control" placeholder="' . esc_attr($opts['placeholder']) . '">
|
206 |
</div>';
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
<input id="' . esc_attr($opts['name']) . '" name="' . esc_attr($opts['name']) . '" type="text" class="form-control" value="' . esc_attr($opts['value']) . '">
|
218 |
<span class="input-group-btn">
|
219 |
-
<button id="upload_' . esc_attr($opts['name']) . '_button" class="ssbpUpload ssbp_upload_btn btn btn-default" data-ssbp-input="' . esc_attr($opts['name']) . '" type="button">Upload</button>
|
220 |
</span>
|
221 |
</div>';
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
<input id="' . esc_attr($opts['name']) . '" name="' . esc_attr($opts['name']) . '" type="number" class="form-control" value="' . esc_attr($opts['value']) . '" placeholder="' . esc_attr($opts['placeholder']) . '"' . esc_attr($max) . ' />
|
227 |
-
<span class="input-group-addon">' . esc_html($opts['addon']) . '</span>
|
228 |
</div>';
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Forms {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Plugin instance.
|
19 |
+
*
|
20 |
+
* @var object
|
21 |
+
*/
|
22 |
+
public $plugin;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Checkboxes.
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
public $ssba_checkboxes;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Class constructor.
|
33 |
+
*
|
34 |
+
* @param object $plugin Plugin class.
|
35 |
+
*/
|
36 |
+
public function __construct( $plugin ) {
|
37 |
+
$this->plugin = $plugin;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Opening form tag.
|
42 |
+
*
|
43 |
+
* @param string $wrap The wrap class.
|
44 |
+
* @param string $action The action attribute.
|
45 |
+
* @param string $class The class attribute.
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function open( $wrap, $action = '', $class = '' ) {
|
50 |
+
$wrap = $wrap ? 'ssba-form-wrap' : '';
|
51 |
+
$return = '<div class="' . esc_attr( $wrap ) . '">';
|
52 |
+
$return .= '<form class="form-horizontal ' . esc_attr( $class ) . '" id="ssba-admin-form" method="post" action="' . esc_attr( $action ) . '">';
|
53 |
+
|
54 |
+
// Required hidden fields.
|
55 |
+
$return .= wp_nonce_field( 'ssba_save_settings', 'ssba_save_nonce' );
|
56 |
+
$return .= '<input type="hidden" name="ssba_options" />';
|
57 |
+
|
58 |
+
// Open fieldset.
|
59 |
+
$return .= '<fieldset>';
|
60 |
+
|
61 |
+
return $return;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Close form tag.
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function close() {
|
70 |
+
// Save button.
|
71 |
+
$return = '<button id="submit" class="ssba-btn-save btn btn-lg btn-primary"><i class="fa fa-floppy-o"></i></button>';
|
72 |
+
|
73 |
+
// Success button.
|
74 |
+
$return .= '<button type="button" class="ssba-btn-save-success btn btn-lg btn-success"><i class="fa fa-check"></i></button>';
|
75 |
+
|
76 |
+
// Close fieldset.
|
77 |
+
$return .= '</fieldset>';
|
78 |
+
|
79 |
+
// Close form.
|
80 |
+
$return .= '</form>';
|
81 |
+
$return .= '</div>';
|
82 |
+
|
83 |
+
return $return;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Inline checkboxes.
|
88 |
+
*
|
89 |
+
* @param array $opts The option array.
|
90 |
+
*
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
public function ssbp_checkboxes( $opts ) {
|
94 |
+
// Check if opts passed is an array.
|
95 |
+
if ( ! is_array( $opts ) ) {
|
96 |
+
return 'Variable passed not an array';
|
97 |
+
}
|
98 |
+
|
99 |
+
// Define variable.
|
100 |
+
$input = '';
|
101 |
+
|
102 |
+
// If we're including the form group div.
|
103 |
+
if ( $opts['form_group'] ) {
|
104 |
+
$input .= '<div class="form-group">';
|
105 |
+
}
|
106 |
+
|
107 |
+
// If a tooltip has been set.
|
108 |
+
if ( isset( $opts['tooltip'] ) && '' !== $opts['tooltip'] ) {
|
109 |
+
$tooltip = 'data-toggle="tooltip" data-placement="right" data-original-title="' . esc_attr( $opts['tooltip'] ) . '"';
|
110 |
+
} else {
|
111 |
+
$tooltip = '';
|
112 |
+
}
|
113 |
+
|
114 |
+
// Label with tooltip.
|
115 |
+
$input .= '<label class="control-label" ' . esc_attr( $tooltip ) . '>' . esc_html( $opts['label'] ) . '</label>';
|
116 |
+
|
117 |
+
// Input div.
|
118 |
+
$input .= '<div class="">';
|
119 |
+
|
120 |
+
// Add all checkboxes.
|
121 |
+
foreach ( $opts['checkboxes'] as $checkbox => $value ) {
|
122 |
+
$input .= $this->ssbp_add_checkboxes( $value, $checkbox );
|
123 |
+
}
|
124 |
+
|
125 |
+
// Close input div.
|
126 |
+
$input .= '</div>';
|
127 |
+
|
128 |
+
// If we're including the form group div.
|
129 |
+
if ( $opts['form_group'] ) {
|
130 |
+
$input .= '</div>';
|
131 |
+
}
|
132 |
+
|
133 |
+
// Return the input.
|
134 |
+
return $input;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Checkboxes.
|
139 |
+
*
|
140 |
+
* @param array $value The checked prop.
|
141 |
+
* @param string $key The label value.
|
142 |
+
*/
|
143 |
+
public function ssbp_add_checkboxes( $value, $key ) {
|
144 |
+
$checked = false === empty( $value['checked'] );
|
145 |
+
|
146 |
+
$ssba_checkboxes = '<label class="checkbox-inline no_indent"> '
|
147 |
+
. esc_html( $key )
|
148 |
+
. '<br /> <input type="checkbox" id="'
|
149 |
+
. esc_attr( $value['value'] )
|
150 |
+
. '" name="'
|
151 |
+
. esc_attr( $value['value'] )
|
152 |
+
. '" value="Y" '
|
153 |
+
. checked( $checked, true, false ) . '>
|
|
|
154 |
</label>';
|
155 |
|
156 |
+
return $ssba_checkboxes;
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Form input with group.
|
161 |
+
*
|
162 |
+
* @param array $opts The option array.
|
163 |
+
*
|
164 |
+
* @return string
|
165 |
+
*/
|
166 |
+
public function ssbp_input( $opts ) {
|
167 |
+
// Check if opts passed is an array.
|
168 |
+
if ( ! is_array( $opts ) ) {
|
169 |
+
return 'Variable passed not an array';
|
170 |
+
}
|
171 |
+
|
172 |
+
// Define variable.
|
173 |
+
$input = '';
|
174 |
+
|
175 |
+
// If we're including the form group div.
|
176 |
+
if ( $opts['form_group'] ) {
|
177 |
+
$input .= '<div class="form-group">';
|
178 |
+
}
|
179 |
+
|
180 |
+
// If a tooltip has been set.
|
181 |
+
if ( isset( $opts['tooltip'] ) && '' !== $opts['tooltip'] ) {
|
182 |
+
$tooltip = 'data-toggle="tooltip" data-placement="right" data-original-title="' . esc_attr( $opts['tooltip'] ) . '"';
|
183 |
+
} else {
|
184 |
+
$tooltip = '';
|
185 |
+
}
|
186 |
+
|
187 |
+
// Label with tooltip.
|
188 |
+
$input .= '<label for="' . esc_attr( $opts['name'] ) . '" class="control-label" ' . $tooltip . '>' . esc_html( $opts['label'] ) . '</label>';
|
189 |
+
|
190 |
+
// Input div.
|
191 |
+
$input .= '<div class="input-div">';
|
192 |
+
$disabled = isset( $opts['disabled'] ) ? $opts['disabled'] : null;
|
193 |
+
|
194 |
+
// Switch based on the input type.
|
195 |
+
switch ( $opts['type'] ) {
|
196 |
+
case 'text':
|
197 |
+
default:
|
198 |
+
$input .= '<input class="form-control" name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '" type="text" value="' . esc_attr( $opts['value'] ) . '" placeholder="' . esc_attr( $opts['placeholder'] ) . '" ' . $disabled . ' />';
|
199 |
+
break;
|
200 |
+
case 'text_prefix':
|
201 |
+
$input .= '<div class="input-group">
|
202 |
+
<span class="input-group-addon">' . esc_html( $opts['prefix'] ) . '</span>
|
203 |
+
<input name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '" type="text" value="' . esc_attr( $opts['value'] ) . '" class="form-control" placeholder="' . esc_attr( $opts['placeholder'] ) . '">
|
|
|
204 |
</div>';
|
205 |
+
break;
|
206 |
+
case 'error':
|
207 |
+
$input .= '<p class="text-danger">' . esc_html( $opts['error'] ) . '</p>';
|
208 |
+
break;
|
209 |
+
case 'number':
|
210 |
+
$max = isset( $opts['max'] ) ? 'max=' . $opts['max'] : '';
|
211 |
+
$input .= '<input class="form-control" name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '" type="number" value="' . esc_attr( $opts['value'] ) . '" placeholder="' . esc_attr( $opts['placeholder'] ) . '"' . esc_attr( $max ) . ' />';
|
212 |
+
break;
|
213 |
+
case 'image_upload':
|
214 |
+
$input .= '<div class="input-group">
|
215 |
+
<input id="' . esc_attr( $opts['name'] ) . '" name="' . esc_attr( $opts['name'] ) . '" type="text" class="form-control" value="' . esc_attr( $opts['value'] ) . '">
|
216 |
<span class="input-group-btn">
|
217 |
+
<button id="upload_' . esc_attr( $opts['name'] ) . '_button" class="ssbpUpload ssbp_upload_btn btn btn-default" data-ssbp-input="' . esc_attr( $opts['name'] ) . '" type="button">Upload</button>
|
218 |
</span>
|
219 |
</div>';
|
220 |
+
break;
|
221 |
+
case 'number_addon':
|
222 |
+
$max = isset( $opts['max'] ) ? 'max=' . $opts['max'] : '';
|
223 |
+
$input .= '<div class="input-group">
|
224 |
+
<input id="' . esc_attr( $opts['name'] ) . '" name="' . esc_attr( $opts['name'] ) . '" type="number" class="form-control" value="' . esc_attr( $opts['value'] ) . '" placeholder="' . esc_attr( $opts['placeholder'] ) . '"' . esc_attr( $max ) . ' />
|
225 |
+
<span class="input-group-addon">' . esc_html( $opts['addon'] ) . '</span>
|
226 |
</div>';
|
227 |
+
break;
|
228 |
+
case 'colorpicker':
|
229 |
+
$value = '' !== $opts['value'] ? $opts['value'] : '#eaeaea';
|
230 |
+
$input .= '<input id="' . esc_attr( $opts['name'] ) . '" name="' . esc_attr( $opts['name'] ) . '" type="text" class="ssba-colorpicker form-control" value="' . esc_attr( $opts['value'] ) . '" placeholder="#4582ec" style="border-color: ' . esc_attr( $value ) . '" />';
|
231 |
+
break;
|
232 |
+
case 'textarea':
|
233 |
+
$class = isset( $opts['class'] ) ? $opts['class'] : '';
|
234 |
+
$input .= '<textarea class="form-control ' . esc_attr( $class ) . '" name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '" rows="' . esc_attr( $opts['rows'] ) . '">' . esc_html( $opts['value'] ) . '</textarea>';
|
235 |
+
break;
|
236 |
+
case 'checkbox':
|
237 |
+
$class = isset( $opts['class'] ) ? $opts['class'] : '';
|
238 |
+
$disabled = isset( $opts['disabled'] ) ? $opts['disabled'] : '';
|
239 |
+
$input .= '<input class="' . esc_attr( $class ) . '" name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '" type="checkbox" ' . esc_attr( $opts['checked'] ) . ' value="' . esc_attr( $opts['value'] ) . '" ' . esc_attr( $disabled ) . ' />';
|
240 |
+
break;
|
241 |
+
case 'select':
|
242 |
+
$input .= '<select class="form-control" name="' . esc_attr( $opts['name'] ) . '" id="' . esc_attr( $opts['name'] ) . '">';
|
243 |
+
|
244 |
+
// Add all options.
|
245 |
+
foreach ( $opts['options'] as $key => $value ) {
|
246 |
+
$selected = (string) $value === $opts['selected'] ? 'selected=selected' : '';
|
247 |
+
$input .= '<option value="' . esc_attr( $value ) . '" ' . esc_attr( $selected ) . '>' . esc_html( $key ) . '</option>';
|
248 |
+
}
|
249 |
+
|
250 |
+
$input .= '</select>';
|
251 |
+
break;
|
252 |
+
}
|
253 |
+
|
254 |
+
// Close input div.
|
255 |
+
$input .= '</div>';
|
256 |
+
|
257 |
+
// If we're including the form group div.
|
258 |
+
if ( $opts['form_group'] ) {
|
259 |
+
$input .= '</div>';
|
260 |
+
}
|
261 |
+
|
262 |
+
// Return the input.
|
263 |
+
return $input;
|
264 |
+
}
|
265 |
}
|
php/class-plugin-base.php
CHANGED
@@ -62,16 +62,16 @@ abstract class Plugin_Base {
|
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
-
protected $
|
66 |
|
67 |
/**
|
68 |
* Plugin_Base constructor.
|
69 |
*/
|
70 |
public function __construct() {
|
71 |
-
$location
|
72 |
-
$this->slug
|
73 |
$this->dir_path = $location['dir_path'];
|
74 |
-
$this->dir_url
|
75 |
|
76 |
spl_autoload_register( array( $this, 'autoload' ) );
|
77 |
$this->add_doc_hooks();
|
@@ -80,7 +80,7 @@ abstract class Plugin_Base {
|
|
80 |
/**
|
81 |
* Plugin_Base destructor.
|
82 |
*/
|
83 |
-
function __destruct() {
|
84 |
$this->remove_doc_hooks();
|
85 |
}
|
86 |
|
@@ -145,9 +145,9 @@ abstract class Plugin_Base {
|
|
145 |
* @return array
|
146 |
*/
|
147 |
public function locate_plugin() {
|
148 |
-
$base_file
|
149 |
-
$dir_url
|
150 |
-
$dir_path
|
151 |
$dir_basename = basename( $dir_path );
|
152 |
|
153 |
return compact( 'dir_url', 'dir_path', 'dir_basename' );
|
@@ -191,12 +191,15 @@ abstract class Plugin_Base {
|
|
191 |
*/
|
192 |
public function add_filter( $name, $callback, $args = array() ) {
|
193 |
// Merge defaults.
|
194 |
-
$args = array_merge(
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
200 |
}
|
201 |
|
202 |
/**
|
@@ -208,7 +211,7 @@ abstract class Plugin_Base {
|
|
208 |
* @return mixed
|
209 |
*/
|
210 |
public function add_shortcode( $name, $callback ) {
|
211 |
-
return $this->
|
212 |
}
|
213 |
|
214 |
/**
|
@@ -222,12 +225,15 @@ abstract class Plugin_Base {
|
|
222 |
*/
|
223 |
public function add_action( $name, $callback, $args = array() ) {
|
224 |
// Merge defaults.
|
225 |
-
$args = array_merge(
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
231 |
}
|
232 |
|
233 |
/**
|
@@ -240,11 +246,11 @@ abstract class Plugin_Base {
|
|
240 |
*
|
241 |
* @return mixed
|
242 |
*/
|
243 |
-
protected function
|
244 |
-
$priority
|
245 |
-
$arg_count = isset( $args['arg_count'] ) ? $args['arg_count'] : PHP_INT_MAX;
|
246 |
-
$fn
|
247 |
-
$retval
|
248 |
|
249 |
return $retval;
|
250 |
}
|
@@ -259,22 +265,22 @@ abstract class Plugin_Base {
|
|
259 |
$object = $this;
|
260 |
}
|
261 |
$class_name = get_class( $object );
|
262 |
-
if ( isset( $this->
|
263 |
$notice = sprintf( 'The add_doc_hooks method was already called on %s. Note that the Plugin_Base constructor automatically calls this method.', $class_name );
|
264 |
// @codingStandardsIgnoreStart
|
265 |
trigger_error( esc_html( $notice ), \E_USER_NOTICE );
|
266 |
// @codingStandardsIgnoreEnd
|
267 |
return;
|
268 |
}
|
269 |
-
$this->
|
270 |
-
$reflector
|
271 |
foreach ( $reflector->getMethods() as $method ) {
|
272 |
-
$doc
|
273 |
$arg_count = $method->getNumberOfParameters();
|
274 |
if ( preg_match_all( '#\* @(?P<type>filter|action|shortcode)\s+(?P<name>[a-z0-9\-\._]+)(?:,\s+(?P<priority>\d+))?#', $doc, $matches, PREG_SET_ORDER ) ) {
|
275 |
foreach ( $matches as $match ) {
|
276 |
-
$type
|
277 |
-
$name
|
278 |
$priority = empty( $match['priority'] ) ? 10 : intval( $match['priority'] );
|
279 |
$callback = array( $object, $method->getName() );
|
280 |
call_user_func( array( $this, "add_{$type}" ), $name, $callback, compact( 'priority', 'arg_count' ) );
|
@@ -293,19 +299,19 @@ abstract class Plugin_Base {
|
|
293 |
$object = $this;
|
294 |
}
|
295 |
$class_name = get_class( $object );
|
296 |
-
$reflector
|
297 |
foreach ( $reflector->getMethods() as $method ) {
|
298 |
$doc = $method->getDocComment();
|
299 |
if ( preg_match_all( '#\* @(?P<type>filter|action|shortcode)\s+(?P<name>[a-z0-9\-\._]+)(?:,\s+(?P<priority>\d+))?#', $doc, $matches, PREG_SET_ORDER ) ) {
|
300 |
foreach ( $matches as $match ) {
|
301 |
-
$type
|
302 |
-
$name
|
303 |
$priority = empty( $match['priority'] ) ? 10 : intval( $match['priority'] );
|
304 |
$callback = array( $object, $method->getName() );
|
305 |
call_user_func( "remove_{$type}", $name, $callback, $priority );
|
306 |
}
|
307 |
}
|
308 |
}
|
309 |
-
unset( $this->
|
310 |
}
|
311 |
}
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
+
protected $called_doc_hooks = array();
|
66 |
|
67 |
/**
|
68 |
* Plugin_Base constructor.
|
69 |
*/
|
70 |
public function __construct() {
|
71 |
+
$location = $this->locate_plugin();
|
72 |
+
$this->slug = $location['dir_basename'];
|
73 |
$this->dir_path = $location['dir_path'];
|
74 |
+
$this->dir_url = $location['dir_url'];
|
75 |
|
76 |
spl_autoload_register( array( $this, 'autoload' ) );
|
77 |
$this->add_doc_hooks();
|
80 |
/**
|
81 |
* Plugin_Base destructor.
|
82 |
*/
|
83 |
+
public function __destruct() {
|
84 |
$this->remove_doc_hooks();
|
85 |
}
|
86 |
|
145 |
* @return array
|
146 |
*/
|
147 |
public function locate_plugin() {
|
148 |
+
$base_file = str_replace( 'php', '', __FILE__ );
|
149 |
+
$dir_url = trailingslashit( plugins_url( '', $base_file ) );
|
150 |
+
$dir_path = substr( str_replace( 'class-plugin-base', '', $base_file ), 0, -2 );
|
151 |
$dir_basename = basename( $dir_path );
|
152 |
|
153 |
return compact( 'dir_url', 'dir_path', 'dir_basename' );
|
191 |
*/
|
192 |
public function add_filter( $name, $callback, $args = array() ) {
|
193 |
// Merge defaults.
|
194 |
+
$args = array_merge(
|
195 |
+
array(
|
196 |
+
'priority' => 10,
|
197 |
+
'arg_count' => PHP_INT_MAX,
|
198 |
+
),
|
199 |
+
$args
|
200 |
+
);
|
201 |
+
|
202 |
+
return $this->add_hook( 'filter', $name, $callback, $args );
|
203 |
}
|
204 |
|
205 |
/**
|
211 |
* @return mixed
|
212 |
*/
|
213 |
public function add_shortcode( $name, $callback ) {
|
214 |
+
return $this->add_hook( 'shortcode', $name, $callback );
|
215 |
}
|
216 |
|
217 |
/**
|
225 |
*/
|
226 |
public function add_action( $name, $callback, $args = array() ) {
|
227 |
// Merge defaults.
|
228 |
+
$args = array_merge(
|
229 |
+
array(
|
230 |
+
'priority' => 10,
|
231 |
+
'arg_count' => PHP_INT_MAX,
|
232 |
+
),
|
233 |
+
$args
|
234 |
+
);
|
235 |
+
|
236 |
+
return $this->add_hook( 'action', $name, $callback, $args );
|
237 |
}
|
238 |
|
239 |
/**
|
246 |
*
|
247 |
* @return mixed
|
248 |
*/
|
249 |
+
protected function add_hook( $type, $name, $callback, $args = array() ) {
|
250 |
+
$priority = true === isset( $args['priority'] ) ? $args['priority'] : 10;
|
251 |
+
$arg_count = true === isset( $args['arg_count'] ) ? $args['arg_count'] : PHP_INT_MAX;
|
252 |
+
$fn = sprintf( '\add_%s', $type );
|
253 |
+
$retval = \call_user_func( $fn, $name, $callback, $priority, $arg_count );
|
254 |
|
255 |
return $retval;
|
256 |
}
|
265 |
$object = $this;
|
266 |
}
|
267 |
$class_name = get_class( $object );
|
268 |
+
if ( isset( $this->called_doc_hooks[ $class_name ] ) ) {
|
269 |
$notice = sprintf( 'The add_doc_hooks method was already called on %s. Note that the Plugin_Base constructor automatically calls this method.', $class_name );
|
270 |
// @codingStandardsIgnoreStart
|
271 |
trigger_error( esc_html( $notice ), \E_USER_NOTICE );
|
272 |
// @codingStandardsIgnoreEnd
|
273 |
return;
|
274 |
}
|
275 |
+
$this->called_doc_hooks[ $class_name ] = true;
|
276 |
+
$reflector = new \ReflectionObject( $object );
|
277 |
foreach ( $reflector->getMethods() as $method ) {
|
278 |
+
$doc = $method->getDocComment();
|
279 |
$arg_count = $method->getNumberOfParameters();
|
280 |
if ( preg_match_all( '#\* @(?P<type>filter|action|shortcode)\s+(?P<name>[a-z0-9\-\._]+)(?:,\s+(?P<priority>\d+))?#', $doc, $matches, PREG_SET_ORDER ) ) {
|
281 |
foreach ( $matches as $match ) {
|
282 |
+
$type = $match['type'];
|
283 |
+
$name = $match['name'];
|
284 |
$priority = empty( $match['priority'] ) ? 10 : intval( $match['priority'] );
|
285 |
$callback = array( $object, $method->getName() );
|
286 |
call_user_func( array( $this, "add_{$type}" ), $name, $callback, compact( 'priority', 'arg_count' ) );
|
299 |
$object = $this;
|
300 |
}
|
301 |
$class_name = get_class( $object );
|
302 |
+
$reflector = new \ReflectionObject( $object );
|
303 |
foreach ( $reflector->getMethods() as $method ) {
|
304 |
$doc = $method->getDocComment();
|
305 |
if ( preg_match_all( '#\* @(?P<type>filter|action|shortcode)\s+(?P<name>[a-z0-9\-\._]+)(?:,\s+(?P<priority>\d+))?#', $doc, $matches, PREG_SET_ORDER ) ) {
|
306 |
foreach ( $matches as $match ) {
|
307 |
+
$type = $match['type'];
|
308 |
+
$name = $match['name'];
|
309 |
$priority = empty( $match['priority'] ) ? 10 : intval( $match['priority'] );
|
310 |
$callback = array( $object, $method->getName() );
|
311 |
call_user_func( "remove_{$type}", $name, $callback, $priority );
|
312 |
}
|
313 |
}
|
314 |
}
|
315 |
+
unset( $this->called_doc_hooks[ $class_name ] );
|
316 |
}
|
317 |
}
|
php/class-plugin.php
CHANGED
@@ -10,93 +10,198 @@ namespace SimpleShareButtonsAdder;
|
|
10 |
/**
|
11 |
* Main plugin bootstrap file.
|
12 |
*/
|
13 |
-
class Plugin extends Plugin_Base
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
10 |
/**
|
11 |
* Main plugin bootstrap file.
|
12 |
*/
|
13 |
+
class Plugin extends Plugin_Base {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Plugin constructor.
|
17 |
+
*/
|
18 |
+
public function __construct() {
|
19 |
+
parent::__construct();
|
20 |
+
|
21 |
+
// Define some prefixes to use througout the plugin.
|
22 |
+
$this->assets_prefix = strtolower( preg_replace( '/\B([A-Z])/', '-$1', __NAMESPACE__ ) );
|
23 |
+
$this->meta_prefix = strtolower( preg_replace( '/\B([A-Z])/', '_$1', __NAMESPACE__ ) );
|
24 |
+
|
25 |
+
// Globals.
|
26 |
+
$class_ssba = new Simple_Share_Buttons_Adder( $this );
|
27 |
+
$database = new Database( $this, $class_ssba );
|
28 |
+
$forms = new Forms( $this );
|
29 |
+
$widget_class = new Widget();
|
30 |
+
$admin_panel = new Admin_Panel( $this, $class_ssba, $forms, $widget_class );
|
31 |
+
|
32 |
+
// Initiate classes.
|
33 |
+
$classes = array(
|
34 |
+
$class_ssba,
|
35 |
+
$database,
|
36 |
+
$admin_panel,
|
37 |
+
$widget_class,
|
38 |
+
$forms,
|
39 |
+
new Styles( $this, $class_ssba ),
|
40 |
+
new Admin_Bits( $this, $class_ssba, $database, $admin_panel ),
|
41 |
+
new Buttons( $this, $class_ssba, $admin_panel ),
|
42 |
+
);
|
43 |
+
|
44 |
+
// Add classes doc hooks.
|
45 |
+
foreach ( $classes as $instance ) {
|
46 |
+
$this->add_doc_hooks( $instance );
|
47 |
+
}
|
48 |
+
|
49 |
+
// Define some prefixes to use througout the plugin.
|
50 |
+
$this->assets_prefix = strtolower( preg_replace( '/\B([A-Z])/', '-$1', __NAMESPACE__ ) );
|
51 |
+
$this->meta_prefix = strtolower( preg_replace( '/\B([A-Z])/', '_$1', __NAMESPACE__ ) );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Register assets.
|
56 |
+
*
|
57 |
+
* @action wp_enqueue_scripts
|
58 |
+
*/
|
59 |
+
public function register_assets() {
|
60 |
+
$propertyid = get_option( 'ssba_property_id' );
|
61 |
+
|
62 |
+
wp_register_script(
|
63 |
+
"{$this->assets_prefix}-ssba",
|
64 |
+
"{$this->dir_url}js/ssba.js",
|
65 |
+
array( 'jquery' ),
|
66 |
+
filemtime( "{$this->dir_path}js/ssba.js" ),
|
67 |
+
true
|
68 |
+
);
|
69 |
+
|
70 |
+
wp_register_style(
|
71 |
+
"{$this->assets_prefix}-indie",
|
72 |
+
'//fonts.googleapis.com/css?family=Indie+Flower',
|
73 |
+
array(),
|
74 |
+
SSBA_VERSION
|
75 |
+
);
|
76 |
+
|
77 |
+
wp_register_style(
|
78 |
+
"{$this->assets_prefix}-reenie",
|
79 |
+
'//fonts.googleapis.com/css?family=Reenie+Beanie',
|
80 |
+
array(),
|
81 |
+
SSBA_VERSION
|
82 |
+
);
|
83 |
+
|
84 |
+
wp_register_style(
|
85 |
+
"{$this->assets_prefix}-ssba",
|
86 |
+
"{$this->dir_url}css/ssba.css",
|
87 |
+
array(),
|
88 |
+
filemtime( "{$this->dir_path}css/ssba.css" )
|
89 |
+
);
|
90 |
+
|
91 |
+
wp_register_style(
|
92 |
+
"{$this->assets_prefix}-font-awesome",
|
93 |
+
'//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css',
|
94 |
+
array(),
|
95 |
+
SSBA_VERSION
|
96 |
+
);
|
97 |
+
|
98 |
+
if ( false === empty( $propertyid ) ) {
|
99 |
+
wp_register_script(
|
100 |
+
"{$this->assets_prefix}-mu",
|
101 |
+
"//platform-api.sharethis.com/js/sharethis.js#property={$propertyid}&product=gdpr-compliance-tool-v2",
|
102 |
+
null,
|
103 |
+
SSBA_VERSION,
|
104 |
+
false
|
105 |
+
);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Register admin scripts/styles.
|
111 |
+
*
|
112 |
+
* @action admin_enqueue_scripts
|
113 |
+
*/
|
114 |
+
public function register_admin_assets() {
|
115 |
+
wp_register_script(
|
116 |
+
"{$this->assets_prefix}-admin",
|
117 |
+
"{$this->dir_url}js/admin.js",
|
118 |
+
array( 'jquery', 'jquery-ui-sortable', 'wp-util' ),
|
119 |
+
filemtime( "{$this->dir_path}js/admin.js" ),
|
120 |
+
false
|
121 |
+
);
|
122 |
+
wp_register_script(
|
123 |
+
"{$this->assets_prefix}-bootstrap-js",
|
124 |
+
"{$this->dir_url}js/vendor/bootstrap.js",
|
125 |
+
array(),
|
126 |
+
filemtime( "{$this->dir_path}js/vendor/bootstrap.js" ),
|
127 |
+
false
|
128 |
+
);
|
129 |
+
wp_register_script(
|
130 |
+
"{$this->assets_prefix}-colorpicker",
|
131 |
+
"{$this->dir_url}js/vendor/colorpicker.js",
|
132 |
+
array(),
|
133 |
+
filemtime( "{$this->dir_path}js/vendor/colorpicker.js" ),
|
134 |
+
false
|
135 |
+
);
|
136 |
+
wp_register_script(
|
137 |
+
"{$this->assets_prefix}-switch",
|
138 |
+
"{$this->dir_url}js/vendor/switch.js",
|
139 |
+
array(),
|
140 |
+
filemtime( "{$this->dir_path}js/vendor/switch.js" ),
|
141 |
+
false
|
142 |
+
);
|
143 |
+
|
144 |
+
wp_register_style(
|
145 |
+
"{$this->assets_prefix}-admin",
|
146 |
+
"{$this->dir_url}css/admin.css",
|
147 |
+
false,
|
148 |
+
time()
|
149 |
+
);
|
150 |
+
|
151 |
+
wp_register_style(
|
152 |
+
"{$this->assets_prefix}-readable",
|
153 |
+
"{$this->dir_url}css/readable.css",
|
154 |
+
array(),
|
155 |
+
filemtime( "{$this->dir_path}css/readable.css" )
|
156 |
+
);
|
157 |
+
|
158 |
+
wp_register_style(
|
159 |
+
"{$this->assets_prefix}-colorpicker",
|
160 |
+
"{$this->dir_url}css/colorpicker.css",
|
161 |
+
array(),
|
162 |
+
filemtime( "{$this->dir_path}css/colorpicker.css" )
|
163 |
+
);
|
164 |
+
|
165 |
+
wp_register_style(
|
166 |
+
"{$this->assets_prefix}-switch",
|
167 |
+
"{$this->dir_url}css/switch.css",
|
168 |
+
array(),
|
169 |
+
filemtime( "{$this->dir_path}css/switch.css" )
|
170 |
+
);
|
171 |
+
|
172 |
+
wp_register_style(
|
173 |
+
"{$this->assets_prefix}-admin-theme",
|
174 |
+
"{$this->dir_url}css/admin-theme.css",
|
175 |
+
"{$this->assets_prefix}-font-awesome",
|
176 |
+
filemtime( "{$this->dir_path}css/admin-theme.css" )
|
177 |
+
);
|
178 |
+
|
179 |
+
wp_register_style(
|
180 |
+
"{$this->assets_prefix}-font-awesome",
|
181 |
+
'//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css',
|
182 |
+
array(),
|
183 |
+
SSBA_VERSION
|
184 |
+
);
|
185 |
+
|
186 |
+
wp_register_style(
|
187 |
+
"{$this->assets_prefix}-styles",
|
188 |
+
"{$this->dir_url}css/style.css",
|
189 |
+
array(),
|
190 |
+
filemtime( "{$this->dir_path}css/style.css" )
|
191 |
+
);
|
192 |
+
|
193 |
+
wp_register_style(
|
194 |
+
"{$this->assets_prefix}-indie",
|
195 |
+
'//fonts.googleapis.com/css?family=Indie+Flower',
|
196 |
+
array(),
|
197 |
+
SSBA_VERSION
|
198 |
+
);
|
199 |
+
|
200 |
+
wp_register_style(
|
201 |
+
"{$this->assets_prefix}-reenie",
|
202 |
+
'//fonts.googleapis.com/css?family=Reenie+Beanie',
|
203 |
+
array(),
|
204 |
+
SSBA_VERSION
|
205 |
+
);
|
206 |
+
}
|
207 |
}
|
php/class-simple-share-buttons-adder.php
CHANGED
@@ -12,112 +12,109 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Simple_Share_Buttons_Adder
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
return array_merge($links, $mylinks);
|
122 |
-
}
|
123 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Simple_Share_Buttons_Adder {
|
16 |
+
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Plugin instance.
|
20 |
+
*
|
21 |
+
* @var object
|
22 |
+
*/
|
23 |
+
public $plugin;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Class constructor.
|
27 |
+
*
|
28 |
+
* @param object $plugin Plugin class.
|
29 |
+
*/
|
30 |
+
public function __construct( $plugin ) {
|
31 |
+
$this->plugin = $plugin;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get the SSBA option settings.
|
36 |
+
*
|
37 |
+
* @action init
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function get_ssba_settings() {
|
41 |
+
if ( SSBA_VERSION < 8 ) {
|
42 |
+
$this->convert_settings();
|
43 |
+
}
|
44 |
+
|
45 |
+
$ssba_settings = get_option( 'ssba_settings', true );
|
46 |
+
|
47 |
+
// Decode and return settings.
|
48 |
+
return $ssba_settings;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Convert settings to non JSON if they exist.
|
53 |
+
*/
|
54 |
+
private function convert_settings() {
|
55 |
+
// On update convert settings to non-json.
|
56 |
+
// Only update if ssba_settings exist already.
|
57 |
+
if ( true === empty( get_option( 'convert_json_ssba_settings' ) )
|
58 |
+
&& false === empty( get_option( 'ssba_settings' ) )
|
59 |
+
) {
|
60 |
+
$convert_settings = json_decode( get_option( 'ssba_settings' ), true );
|
61 |
+
|
62 |
+
update_option( 'ssba_settings', $convert_settings );
|
63 |
+
update_option( 'convert_json_ssba_settings', true );
|
64 |
+
} elseif ( empty( get_option( 'ssba_settings' ) ) ) {
|
65 |
+
update_option( 'convert_json_ssba_settings', true );
|
66 |
+
}
|
67 |
+
|
68 |
+
// On update convert settings to non-json.
|
69 |
+
// Only update if ssba_settings exist already.
|
70 |
+
if ( empty( get_option( 'convert_json_ssba_buttons' ) ) && ! empty( get_option( 'ssba_buttons' ) ) ) {
|
71 |
+
$convert_buttons = json_decode( get_option( 'ssba_buttons' ), true );
|
72 |
+
|
73 |
+
update_option( 'ssba_buttons', $convert_buttons );
|
74 |
+
update_option( 'convert_json_ssba_buttons', true );
|
75 |
+
|
76 |
+
wp_safe_redirect( '/' );
|
77 |
+
} elseif ( empty( get_option( 'ssba_buttons' ) ) ) {
|
78 |
+
update_option( 'convert_json_ssba_buttons', true );
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Update an array of options.
|
84 |
+
*
|
85 |
+
* @param array $arr_options The options array.
|
86 |
+
*/
|
87 |
+
public function ssba_update_options( $arr_options ) {
|
88 |
+
// If not given an array.
|
89 |
+
if ( false === is_array( $arr_options ) ) {
|
90 |
+
return esc_html__( 'Value parsed not an array', 'simple-share-buttons-adder' );
|
91 |
+
}
|
92 |
+
|
93 |
+
// Get ssba settings.
|
94 |
+
$ssba_settings = get_option( 'ssba_settings', true );
|
95 |
+
|
96 |
+
// Loop through array given.
|
97 |
+
foreach ( $arr_options as $name => $value ) {
|
98 |
+
// Update/add the option in the array.
|
99 |
+
$ssba_settings[ $name ] = $value;
|
100 |
+
}
|
101 |
+
|
102 |
+
// Update the option in the db.
|
103 |
+
update_option( 'ssba_settings', $ssba_settings );
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Add setting link to plugin page.
|
108 |
+
*
|
109 |
+
* @param array $links Links array.
|
110 |
+
*
|
111 |
+
* @return array Modified links array.
|
112 |
+
*/
|
113 |
+
public function add_action_links( $links ) {
|
114 |
+
$mylinks = array(
|
115 |
+
'<a href="' . admin_url( 'options-general.php?page=simple-share-buttons-adder' ) . '">Settings</a>',
|
116 |
+
);
|
117 |
+
|
118 |
+
return array_merge( $links, $mylinks );
|
119 |
+
}
|
|
|
|
|
|
|
120 |
}
|
php/class-styles.php
CHANGED
@@ -12,129 +12,132 @@ namespace SimpleShareButtonsAdder;
|
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
-
class Styles
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
110 |
|
111 |
/**
|
112 |
* Generate style.
|
113 |
*
|
114 |
* @action wp_enqueue_scripts
|
115 |
*/
|
116 |
-
public function get_ssba_style()
|
117 |
-
{
|
118 |
// Query the db for current ssba settings.
|
119 |
$arr_settings = $this->class_ssba->get_ssba_settings();
|
120 |
|
121 |
-
$facebook_app_id = true === empty($arr_settings['plus_facebook_app_id']) ? $arr_settings['facebook_app_id'] : $arr_settings['plus_facebook_app_id'];
|
122 |
|
123 |
// If the sharethis terms have been accepted.
|
124 |
-
if ('Y' === $arr_settings['accepted_sharethis_terms'] && (('Y' !== $arr_settings['ssba_new_buttons'] && 'Y' !== $arr_settings['ignore_facebook_sdk']) || ('Y' === $arr_settings['ssba_new_buttons'] && 'Y' !== $arr_settings['plus_ignore_facebook_sdk']))) {
|
125 |
-
//
|
126 |
-
if (false === empty($facebook_app_id)) {
|
127 |
$src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6&appID=' . $facebook_app_id;
|
128 |
} else {
|
129 |
$src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6';
|
130 |
}
|
131 |
|
132 |
// If an app id has been entered.
|
133 |
-
if (false === empty($facebook_app_id)) {
|
134 |
// Init facebook.
|
135 |
echo "<script>window.fbAsyncInit = function() {
|
136 |
FB.init({
|
137 |
-
appId : '" . $facebook_app_id . "',
|
138 |
xfbml : true,
|
139 |
version : 'v2.6'
|
140 |
});
|
@@ -146,43 +149,43 @@ class Styles
|
|
146 |
var js, fjs = d.getElementsByTagName(s)[0];
|
147 |
if (d.getElementById(id)) {return;}
|
148 |
js = d.createElement(s); js.id = id;
|
149 |
-
js.src = "' . $src . '";
|
150 |
fjs.parentNode.insertBefore(js, fjs);
|
151 |
}(document, \'script\', \'facebook-jssdk\'));</script>';
|
152 |
|
153 |
// If an app id has been entered.
|
154 |
-
if (false === empty($facebook_app_id)) {
|
155 |
// If facebook insights have been enabled.
|
156 |
-
if ('Y' === $arr_settings['facebook_insights']) {
|
157 |
// Add facebook meta tag.
|
158 |
-
echo '<meta property="fb:app_id" content="' . esc_attr($facebook_app_id) . '" />';
|
159 |
}
|
160 |
}
|
161 |
-
}
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
' . esc_html($div_padding) . '
|
178 |
-
' . esc_html($border_width) . '
|
179 |
-
' . esc_html($div_background1) . '
|
180 |
-
' . esc_html($rounded) . '
|
181 |
}
|
182 |
.ssba img
|
183 |
{
|
184 |
-
width: ' . esc_html($arr_settings['ssba_size']) . 'px !important;
|
185 |
-
padding: ' . esc_html($arr_settings['ssba_padding']) . 'px;
|
186 |
border: 0;
|
187 |
box-shadow: none !important;
|
188 |
display: inline !important;
|
@@ -196,25 +199,25 @@ class Styles
|
|
196 |
|
197 |
.ssba .fb-save
|
198 |
{
|
199 |
-
padding: ' . esc_html($arr_settings['ssba_padding']) . 'px;
|
200 |
';
|
201 |
|
202 |
-
|
203 |
.ssba, .ssba a
|
204 |
{
|
205 |
text-decoration:none;
|
206 |
-
' . esc_html($div_background2) . '
|
207 |
-
' . esc_html($font) . '
|
208 |
-
' . esc_html($font_size) . '
|
209 |
-
' . esc_html($font_color) . '
|
210 |
-
' . esc_html($font_weight) . '
|
211 |
}
|
212 |
';
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
right: 100%;
|
219 |
border: solid transparent;
|
220 |
content: " ";
|
@@ -249,67 +252,67 @@ class Styles
|
|
249 |
position: relative;
|
250 |
border: 1px solid #e0dddd;';
|
251 |
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
background: #f5f5f5;
|
257 |
}
|
258 |
.ssba_sharecount:after {
|
259 |
border-right-color: #f5f5f5;
|
260 |
}';
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
background: #ffffff;
|
266 |
}
|
267 |
.ssba_sharecount:after {
|
268 |
border-right-color: #ffffff;
|
269 |
}';
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
background: #42a7e2;
|
275 |
}
|
276 |
.ssba_sharecount:after {
|
277 |
border-right-color: #42a7e2;
|
278 |
}';
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
{border: 0;
|
314 |
box-shadow: none !important;
|
315 |
display: inline !important;
|
@@ -321,91 +324,91 @@ class Styles
|
|
321 |
display: none!important;
|
322 |
}
|
323 |
.ssbp-list li a {' .
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
}
|
328 |
.ssbp-list li a:hover {' .
|
329 |
-
|
330 |
}
|
331 |
|
332 |
.ssbp-list li a::before {' .
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
.ssbp-list li a:hover::before {' .
|
337 |
-
|
338 |
-
|
339 |
.ssbp-list li {
|
340 |
-
' . esc_html($plus_margin) . '
|
341 |
}
|
342 |
|
343 |
.ssba-share-text {
|
344 |
-
' . esc_html($plus_font_size) . ' '
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
}';
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
#ssba-bar-2 .ssbp-bar-list {
|
374 |
-
max-' . esc_html($bar_width) . ';
|
375 |
}
|
376 |
#ssba-bar-2 .ssbp-bar-list li a {' .
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
}
|
381 |
#ssba-bar-2 .ssbp-bar-list li a:hover {' .
|
382 |
-
|
383 |
}
|
384 |
|
385 |
#ssba-bar-2 .ssbp-bar-list li a::before {' .
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
#ssba-bar-2 .ssbp-bar-list li a:hover::before {' .
|
390 |
-
|
391 |
-
|
392 |
#ssba-bar-2 .ssbp-bar-list li {
|
393 |
-
' . esc_html($bar_margin) . '
|
394 |
}';
|
395 |
|
396 |
-
|
397 |
#ssba-bar-2 {
|
398 |
' . $bar_break_point . '
|
399 |
}
|
400 |
}';
|
401 |
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
}
|
12 |
*
|
13 |
* @package SimpleShareButtonsAdder
|
14 |
*/
|
15 |
+
class Styles {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Plugin instance.
|
19 |
+
*
|
20 |
+
* @var object
|
21 |
+
*/
|
22 |
+
public $plugin;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Simple Share Buttons Adder instance.
|
26 |
+
*
|
27 |
+
* @var object
|
28 |
+
*/
|
29 |
+
public $class_ssba;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Class constructor.
|
33 |
+
*
|
34 |
+
* @param object $plugin Plugin class.
|
35 |
+
* @param object $class_ssba Simple Share Buttons Adder class.
|
36 |
+
*/
|
37 |
+
public function __construct( $plugin, $class_ssba ) {
|
38 |
+
$this->plugin = $plugin;
|
39 |
+
$this->class_ssba = $class_ssba;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Add css scripts for page/post use.
|
44 |
+
*
|
45 |
+
* @action wp_enqueue_scripts
|
46 |
+
*/
|
47 |
+
public function ssba_page_scripts() {
|
48 |
+
// Get settings.
|
49 |
+
$arr_settings = $this->class_ssba->get_ssba_settings();
|
50 |
+
|
51 |
+
if ( is_ssl() ) {
|
52 |
+
$st_insights = 'https://ws.sharethis.com/button/st_insights.js';
|
53 |
+
} else {
|
54 |
+
$st_insights = 'http://w.sharethis.com/button/st_insights.js';
|
55 |
+
}
|
56 |
+
|
57 |
+
// Add call to st_insights.js with params.
|
58 |
+
$url = add_query_arg(
|
59 |
+
array(
|
60 |
+
'publisher' => '4d48b7c5-0ae3-43d4-bfbe-3ff8c17a8ae6',
|
61 |
+
'product' => 'simpleshare',
|
62 |
+
),
|
63 |
+
$st_insights
|
64 |
+
);
|
65 |
+
|
66 |
+
if ( 'Y' === $arr_settings['accepted_sharethis_terms'] ) {
|
67 |
+
wp_enqueue_script( 'ssba-sharethis', $url, null, SSBA_VERSION, false );
|
68 |
+
add_filter( 'script_loader_tag', array( $this, 'ssba_script_tags' ), 10, 2 );
|
69 |
+
}
|
70 |
+
|
71 |
+
// Enqueue ST script for ST products.
|
72 |
+
if ( false === empty( get_option( 'ssba_property_id' ) ) ) {
|
73 |
+
wp_dequeue_script( 'ssba-sharethis' );
|
74 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-mu" );
|
75 |
+
}
|
76 |
+
|
77 |
+
// Enqueue main script.
|
78 |
+
wp_enqueue_script( "{$this->plugin->assets_prefix}-ssba" );
|
79 |
+
wp_add_inline_script(
|
80 |
+
"{$this->plugin->assets_prefix}-ssba",
|
81 |
+
sprintf(
|
82 |
+
'Main.boot( %s );',
|
83 |
+
wp_json_encode( array() )
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
// If indie flower font is selected.
|
88 |
+
if ( 'Indie Flower' === $arr_settings['ssba_font_family'] || 'Indie Flower' === $arr_settings['ssba_plus_font_family'] ) {
|
89 |
+
// Font scripts.
|
90 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-indie" );
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( 'Reenie Beanie' === $arr_settings['ssba_font_family'] || 'Reenie Beanie' === $arr_settings['ssba_plus_font_family'] ) {
|
94 |
+
// Font scripts.
|
95 |
+
wp_enqueue_style( "{$this->plugin->assets_prefix}-reenie" );
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Adds ID to sharethis script.
|
101 |
+
*
|
102 |
+
* @param string $tag HTML script tag.
|
103 |
+
* @param string $handle Script handle.
|
104 |
+
*
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
public function ssba_script_tags( $tag, $handle ) {
|
108 |
+
if ( 'ssba-sharethis' === $handle ) {
|
109 |
+
return str_replace( '<script ', '<script id=\'st_insights_js\' ', $tag );
|
110 |
+
}
|
111 |
+
|
112 |
+
return $tag;
|
113 |
+
}
|
114 |
|
115 |
/**
|
116 |
* Generate style.
|
117 |
*
|
118 |
* @action wp_enqueue_scripts
|
119 |
*/
|
120 |
+
public function get_ssba_style() {
|
|
|
121 |
// Query the db for current ssba settings.
|
122 |
$arr_settings = $this->class_ssba->get_ssba_settings();
|
123 |
|
124 |
+
$facebook_app_id = true === empty( $arr_settings['plus_facebook_app_id'] ) ? $arr_settings['facebook_app_id'] : $arr_settings['plus_facebook_app_id'];
|
125 |
|
126 |
// If the sharethis terms have been accepted.
|
127 |
+
if ( 'Y' === $arr_settings['accepted_sharethis_terms'] && ( ( 'Y' !== $arr_settings['ssba_new_buttons'] && 'Y' !== $arr_settings['ignore_facebook_sdk'] ) || ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' !== $arr_settings['plus_ignore_facebook_sdk'] ) ) ) {
|
128 |
+
// If a facebook app id has been set.
|
129 |
+
if ( false === empty( $facebook_app_id ) ) {
|
130 |
$src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6&appID=' . $facebook_app_id;
|
131 |
} else {
|
132 |
$src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6';
|
133 |
}
|
134 |
|
135 |
// If an app id has been entered.
|
136 |
+
if ( false === empty( $facebook_app_id ) ) {
|
137 |
// Init facebook.
|
138 |
echo "<script>window.fbAsyncInit = function() {
|
139 |
FB.init({
|
140 |
+
appId : '" . esc_js( $facebook_app_id ) . "',
|
141 |
xfbml : true,
|
142 |
version : 'v2.6'
|
143 |
});
|
149 |
var js, fjs = d.getElementsByTagName(s)[0];
|
150 |
if (d.getElementById(id)) {return;}
|
151 |
js = d.createElement(s); js.id = id;
|
152 |
+
js.src = "' . esc_js( $src ) . '";
|
153 |
fjs.parentNode.insertBefore(js, fjs);
|
154 |
}(document, \'script\', \'facebook-jssdk\'));</script>';
|
155 |
|
156 |
// If an app id has been entered.
|
157 |
+
if ( false === empty( $facebook_app_id ) ) {
|
158 |
// If facebook insights have been enabled.
|
159 |
+
if ( 'Y' === $arr_settings['facebook_insights'] ) {
|
160 |
// Add facebook meta tag.
|
161 |
+
echo '<meta property="fb:app_id" content="' . esc_attr( $facebook_app_id ) . '" />';
|
162 |
}
|
163 |
}
|
164 |
+
}
|
165 |
+
|
166 |
+
// Check if custom styles haven't been set.
|
167 |
+
if ( 'Y' !== $arr_settings['ssba_custom_styles_enabled'] && 'Y' !== $arr_settings['ssba_new_buttons'] ) {
|
168 |
+
$div_padding = '' !== $arr_settings['ssba_div_padding'] ? 'padding: ' . $arr_settings['ssba_div_padding'] . 'px;' : '';
|
169 |
+
$border_width = '' !== $arr_settings['ssba_border_width'] ? 'border: ' . $arr_settings['ssba_border_width'] . 'px solid ' . $arr_settings['ssba_div_border'] . ';' : '';
|
170 |
+
$div_background1 = '' !== $arr_settings['ssba_div_background'] ? 'background-color: ' . $arr_settings['ssba_div_background'] . ';' : '';
|
171 |
+
$rounded = 'Y' === $arr_settings['ssba_div_rounded_corners'] ? '-moz-border-radius: 10px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; border-radius: 10px; -o-border-radius: 10px;' : '';
|
172 |
+
$div_background2 = '' === $arr_settings['ssba_div_background'] ? 'background: none;' : '';
|
173 |
+
$font = '' !== $arr_settings['ssba_font_family'] ? 'font-family: ' . $arr_settings['ssba_font_family'] . ';' : '';
|
174 |
+
$font_size = '' !== $arr_settings['ssba_font_size'] ? 'font-size: ' . $arr_settings['ssba_font_size'] . 'px;' : '';
|
175 |
+
$font_color = '' !== $arr_settings['ssba_font_color'] ? 'color: ' . $arr_settings['ssba_font_color'] . '!important;' : '';
|
176 |
+
$font_weight = '' !== $arr_settings['ssba_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_font_weight'] . ';' : '';
|
177 |
+
|
178 |
+
// Use set options.
|
179 |
+
$html_ssba_style = ' .ssba {
|
180 |
+
' . esc_html( $div_padding ) . '
|
181 |
+
' . esc_html( $border_width ) . '
|
182 |
+
' . esc_html( $div_background1 ) . '
|
183 |
+
' . esc_html( $rounded ) . '
|
184 |
}
|
185 |
.ssba img
|
186 |
{
|
187 |
+
width: ' . esc_html( $arr_settings['ssba_size'] ) . 'px !important;
|
188 |
+
padding: ' . esc_html( $arr_settings['ssba_padding'] ) . 'px;
|
189 |
border: 0;
|
190 |
box-shadow: none !important;
|
191 |
display: inline !important;
|
199 |
|
200 |
.ssba .fb-save
|
201 |
{
|
202 |
+
padding: ' . esc_html( $arr_settings['ssba_padding'] ) . 'px;
|
203 |
';
|
204 |
|
205 |
+
$html_ssba_style .= 'line-height: ' . esc_html( (int) $arr_settings['ssba_size'] - 5 ) . 'px; }
|
206 |
.ssba, .ssba a
|
207 |
{
|
208 |
text-decoration:none;
|
209 |
+
' . esc_html( $div_background2 ) . '
|
210 |
+
' . esc_html( $font ) . '
|
211 |
+
' . esc_html( $font_size ) . '
|
212 |
+
' . esc_html( $font_color ) . '
|
213 |
+
' . esc_html( $font_weight ) . '
|
214 |
}
|
215 |
';
|
216 |
|
217 |
+
// If counters option is set to Y.
|
218 |
+
if ( 'Y' === $arr_settings['ssba_show_share_count'] ) {
|
219 |
+
// Styles that apply to all counter css sets.
|
220 |
+
$html_ssba_style .= ' .ssba_sharecount:after, .ssba_sharecount:before {
|
221 |
right: 100%;
|
222 |
border: solid transparent;
|
223 |
content: " ";
|
252 |
position: relative;
|
253 |
border: 1px solid #e0dddd;';
|
254 |
|
255 |
+
// If default counter style has been chosen.
|
256 |
+
if ( 'default' === $arr_settings['ssba_share_count_style'] ) {
|
257 |
+
// Style share count.
|
258 |
+
$html_ssba_style .= 'color: #555e58;
|
259 |
background: #f5f5f5;
|
260 |
}
|
261 |
.ssba_sharecount:after {
|
262 |
border-right-color: #f5f5f5;
|
263 |
}';
|
264 |
|
265 |
+
} elseif ( 'white' === $arr_settings['ssba_share_count_style'] ) {
|
266 |
+
// Show white style share counts.
|
267 |
+
$html_ssba_style .= 'color: #555e58;
|
268 |
background: #ffffff;
|
269 |
}
|
270 |
.ssba_sharecount:after {
|
271 |
border-right-color: #ffffff;
|
272 |
}';
|
273 |
|
274 |
+
} elseif ( 'blue' === $arr_settings['ssba_share_count_style'] ) {
|
275 |
+
// Show blue style share counts.
|
276 |
+
$html_ssba_style .= 'color: #ffffff;
|
277 |
background: #42a7e2;
|
278 |
}
|
279 |
.ssba_sharecount:after {
|
280 |
border-right-color: #42a7e2;
|
281 |
}';
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
// If there's any additional css.
|
286 |
+
if ( '' !== $arr_settings['ssba_additional_css'] ) {
|
287 |
+
// Add the additional CSS.
|
288 |
+
$html_ssba_style .= $arr_settings['ssba_additional_css'];
|
289 |
+
}
|
290 |
+
|
291 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
|
292 |
+
} elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] ) { // Else use set options.
|
293 |
+
// Use custom styles.
|
294 |
+
$html_ssba_style = $arr_settings['ssba_custom_styles'];
|
295 |
+
|
296 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
|
297 |
+
}
|
298 |
+
|
299 |
+
if ( 'Y' === $arr_settings['ssba_new_buttons'] ) {
|
300 |
+
// Plus styles.
|
301 |
+
$plus_height = '' !== $arr_settings['ssba_plus_height'] ? 'height: ' . $arr_settings['ssba_plus_height'] . 'px!important;' : 'height: 48px!important;';
|
302 |
+
$plus_width = '' !== $arr_settings['ssba_plus_width'] ? 'width: ' . $arr_settings['ssba_plus_width'] . 'px!important;' : 'width: 48px!important;';
|
303 |
+
$plus_icon = '' !== $arr_settings['ssba_plus_icon_size'] ? 'line-' . $plus_height . '; font-size: ' . $arr_settings['ssba_plus_icon_size'] . 'px;' : 'line-' . $plus_height . '; font-size: 18px;';
|
304 |
+
$plus_margin = '' !== $arr_settings['ssba_plus_margin'] ? 'margin-left: ' . $arr_settings['ssba_plus_margin'] . 'px!important;' : 'margin-left: 7px!important;';
|
305 |
+
$plus_font_style = '' !== $arr_settings['ssba_plus_font_family'] ? 'font-family: ' . $arr_settings['ssba_plus_font_family'] . ';' : 'font-family: inherit;';
|
306 |
+
$plus_font_size = '' !== $arr_settings['ssba_plus_font_size'] ? 'font-size: ' . $arr_settings['ssba_plus_font_size'] . 'px;' : 'font-size: 12px;';
|
307 |
+
$plus_font_weight = '' !== $arr_settings['ssba_plus_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_plus_font_weight'] . ';' : 'font-weight: normal;';
|
308 |
+
$plus_font_color = '' !== $arr_settings['ssba_plus_font_color'] ? 'color: ' . $arr_settings['ssba_plus_font_color'] . '!important;' : '';
|
309 |
+
$plus_icon_color = '' !== $arr_settings['ssba_plus_icon_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_color'] . '!important;' : '';
|
310 |
+
$plus_icon_hover = '' !== $arr_settings['ssba_plus_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_hover_color'] . '!important;' : '';
|
311 |
+
$plus_button_color = '' !== $arr_settings['ssba_plus_button_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_color'] . '!important;' : '';
|
312 |
+
$plus_button_hover = '' !== $arr_settings['ssba_plus_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_hover_color'] . '!important;' : '';
|
313 |
+
|
314 |
+
$html_ssba_style =
|
315 |
+
'.ssba img
|
316 |
{border: 0;
|
317 |
box-shadow: none !important;
|
318 |
display: inline !important;
|
324 |
display: none!important;
|
325 |
}
|
326 |
.ssbp-list li a {' .
|
327 |
+
esc_html( $plus_height ) . ' ' .
|
328 |
+
esc_html( $plus_width ) . ' ' .
|
329 |
+
esc_html( $plus_button_color ) . '
|
330 |
}
|
331 |
.ssbp-list li a:hover {' .
|
332 |
+
esc_html( $plus_button_hover ) . '
|
333 |
}
|
334 |
|
335 |
.ssbp-list li a::before {' .
|
336 |
+
esc_html( $plus_icon ) .
|
337 |
+
esc_html( $plus_icon_color ) .
|
338 |
+
'}
|
339 |
.ssbp-list li a:hover::before {' .
|
340 |
+
esc_html( $plus_icon_hover ) .
|
341 |
+
'}
|
342 |
.ssbp-list li {
|
343 |
+
' . esc_html( $plus_margin ) . '
|
344 |
}
|
345 |
|
346 |
.ssba-share-text {
|
347 |
+
' . esc_html( $plus_font_size ) . ' '
|
348 |
+
. esc_html( $plus_font_color ) . ' '
|
349 |
+
. esc_html( $plus_font_weight ) . ' '
|
350 |
+
. esc_html( $plus_font_style ) . '
|
351 |
}';
|
352 |
|
353 |
+
if ( '' !== $arr_settings['ssba_plus_additional_css'] && 'Y' === $arr_settings['ssba_new_buttons'] ) {
|
354 |
+
$html_ssba_style .= $arr_settings['ssba_plus_additional_css'];
|
355 |
+
}
|
356 |
+
|
357 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
|
358 |
+
}
|
359 |
+
|
360 |
+
// If sharebar custom css is enabled use it.
|
361 |
+
// Check if custom styles haven't been set.
|
362 |
+
if ( 'Y' !== $arr_settings['ssba_bar_custom_styles_enabled'] ) {
|
363 |
+
// Share bar styles.
|
364 |
+
$bar_height = '' !== $arr_settings['ssba_bar_height'] ? 'height: ' . $arr_settings['ssba_bar_height'] . 'px!important;' : 'height: 48px!important;';
|
365 |
+
$bar_width = '' !== $arr_settings['ssba_bar_width'] ? 'width: ' . $arr_settings['ssba_bar_width'] . 'px!important;' : 'width: 48px!important;';
|
366 |
+
$bar_icon = '' !== $arr_settings['ssba_bar_icon_size'] ? 'line-' . $bar_height . '; font-size: ' . $arr_settings['ssba_bar_icon_size'] . 'px;' : 'line-' . $bar_height . '; font-size: 18px;';
|
367 |
+
$bar_margin = '' !== $arr_settings['ssba_bar_margin'] ? 'margin: ' . $arr_settings['ssba_bar_margin'] . 'px 0!important;' : '';
|
368 |
+
$bar_button_color = '' !== $arr_settings['ssba_bar_button_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_color'] . '!important;' : '';
|
369 |
+
$bar_button_hover = '' !== $arr_settings['ssba_bar_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_hover_color'] . '!important;' : '';
|
370 |
+
$bar_icon_color = '' !== $arr_settings['ssba_bar_icon_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_color'] . '!important;' : '';
|
371 |
+
$bar_icon_hover = '' !== $arr_settings['ssba_bar_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_hover_color'] . '!important;' : '';
|
372 |
+
$bar_break_point = 'Y' !== $arr_settings['ssba_bar_mobile'] ? 'display: none;' : 'display: block;';
|
373 |
+
$the_breakpoint = '' === $arr_settings['ssba_mobile_breakpoint'] || null === $arr_settings['ssba_mobile_breakpoint'] ? '750' : $arr_settings['ssba_mobile_breakpoint'];
|
374 |
+
|
375 |
+
$html_bar_ssba_style = '
|
376 |
#ssba-bar-2 .ssbp-bar-list {
|
377 |
+
max-' . esc_html( $bar_width ) . ';
|
378 |
}
|
379 |
#ssba-bar-2 .ssbp-bar-list li a {' .
|
380 |
+
esc_html( $bar_height ) . ' ' .
|
381 |
+
esc_html( $bar_width ) . ' ' .
|
382 |
+
esc_html( $bar_button_color ) . '
|
383 |
}
|
384 |
#ssba-bar-2 .ssbp-bar-list li a:hover {' .
|
385 |
+
esc_html( $bar_button_hover ) . '
|
386 |
}
|
387 |
|
388 |
#ssba-bar-2 .ssbp-bar-list li a::before {' .
|
389 |
+
esc_html( $bar_icon ) .
|
390 |
+
esc_html( $bar_icon_color ) .
|
391 |
+
'}
|
392 |
#ssba-bar-2 .ssbp-bar-list li a:hover::before {' .
|
393 |
+
esc_html( $bar_icon_hover ) .
|
394 |
+
'}
|
395 |
#ssba-bar-2 .ssbp-bar-list li {
|
396 |
+
' . esc_html( $bar_margin ) . '
|
397 |
}';
|
398 |
|
399 |
+
$html_bar_ssba_style .= '@media only screen and ( max-width: ' . $the_breakpoint . 'px ) {
|
400 |
#ssba-bar-2 {
|
401 |
' . $bar_break_point . '
|
402 |
}
|
403 |
}';
|
404 |
|
405 |
+
// If there's any additional css.
|
406 |
+
if ( '' !== $arr_settings['ssba_bar_additional_css'] ) {
|
407 |
+
// Add the additional CSS.
|
408 |
+
$html_bar_ssba_style .= $arr_settings['ssba_bar_additional_css'];
|
409 |
+
}
|
410 |
|
411 |
+
wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_bar_ssba_style ); // WPCS: XSS ok.
|
412 |
+
}
|
413 |
+
}
|
414 |
}
|
php/class-widget.php
CHANGED
@@ -34,13 +34,13 @@ class Widget extends \WP_Widget {
|
|
34 |
* @param array $instance THe widget instance.
|
35 |
*/
|
36 |
public function widget( $args, $instance ) {
|
37 |
-
$before_title
|
38 |
$before_widget = $args['before_widget'];
|
39 |
-
$after_title
|
40 |
-
$after_widget
|
41 |
-
$title
|
42 |
-
$url
|
43 |
-
$pagetitle
|
44 |
|
45 |
echo wp_kses_post( $before_widget );
|
46 |
|
@@ -48,9 +48,9 @@ class Widget extends \WP_Widget {
|
|
48 |
echo wp_kses_post( $before_title . $title . $after_title );
|
49 |
}
|
50 |
|
51 |
-
$shortcode
|
52 |
-
$shortcode .= '' !== $url ? ' url="' . $url . '"' : '';
|
53 |
-
$shortcode .= '' !== $pagetitle ? ' title="' . $pagetitle . '"' : '';
|
54 |
$shortcode .= ' widget="Y"]';
|
55 |
|
56 |
echo do_shortcode( $shortcode );
|
@@ -102,10 +102,10 @@ class Widget extends \WP_Widget {
|
|
102 |
* @return array
|
103 |
*/
|
104 |
public function update( $new_instance, $old_instance ) {
|
105 |
-
$instance
|
106 |
-
$instance['title']
|
107 |
-
$instance['url']
|
108 |
-
$instance['pagetitle'] =
|
109 |
|
110 |
return $instance;
|
111 |
}
|
34 |
* @param array $instance THe widget instance.
|
35 |
*/
|
36 |
public function widget( $args, $instance ) {
|
37 |
+
$before_title = $args['before_title'];
|
38 |
$before_widget = $args['before_widget'];
|
39 |
+
$after_title = $args['after_title'];
|
40 |
+
$after_widget = $args['after_widget'];
|
41 |
+
$title = apply_filters( 'widget_title', $instance['title'] );
|
42 |
+
$url = $instance['url'];
|
43 |
+
$pagetitle = $instance['pagetitle'];
|
44 |
|
45 |
echo wp_kses_post( $before_widget );
|
46 |
|
48 |
echo wp_kses_post( $before_title . $title . $after_title );
|
49 |
}
|
50 |
|
51 |
+
$shortcode = '[ssba-buttons';
|
52 |
+
$shortcode .= '' !== $url ? ' url="' . esc_url( $url ) . '"' : '';
|
53 |
+
$shortcode .= '' !== $pagetitle ? ' title="' . esc_attr( $pagetitle ) . '"' : '';
|
54 |
$shortcode .= ' widget="Y"]';
|
55 |
|
56 |
echo do_shortcode( $shortcode );
|
102 |
* @return array
|
103 |
*/
|
104 |
public function update( $new_instance, $old_instance ) {
|
105 |
+
$instance = array();
|
106 |
+
$instance['title'] = wp_strip_all_tags( $new_instance['title'] );
|
107 |
+
$instance['url'] = wp_strip_all_tags( $new_instance['url'] );
|
108 |
+
$instance['pagetitle'] = wp_strip_all_tags( $new_instance['pagetitle'] );
|
109 |
|
110 |
return $instance;
|
111 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,9 @@
|
|
2 |
Contributors: sharethis, scottstorebloom, scottmweaver, surlyrightclick, DavidoffNeal
|
3 |
Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk, flattr
|
4 |
Requires at least: 4.5
|
5 |
-
Tested up to: 5.9
|
6 |
-
Stable tag: 8.2.
|
|
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
A simple plugin that enables you to add share buttons to all of your posts and/or pages.
|
@@ -66,6 +67,10 @@ Please visit the <a href="https://wordpress.org/support/plugin/simple-share-butt
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
69 |
= 8.2.3 =
|
70 |
* Add: new media assets.
|
71 |
* Test with WordPress 5.9.
|
2 |
Contributors: sharethis, scottstorebloom, scottmweaver, surlyrightclick, DavidoffNeal
|
3 |
Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk, flattr
|
4 |
Requires at least: 4.5
|
5 |
+
Tested up to: 5.9.1
|
6 |
+
Stable tag: 8.2.4
|
7 |
+
Version: 8.2.4
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
A simple plugin that enables you to add share buttons to all of your posts and/or pages.
|
67 |
|
68 |
== Changelog ==
|
69 |
|
70 |
+
= 8.2.4 =
|
71 |
+
* Test with WordPress 5.9.1.
|
72 |
+
* Clean up and sanitize things.
|
73 |
+
|
74 |
= 8.2.3 =
|
75 |
* Add: new media assets.
|
76 |
* Test with WordPress 5.9.
|
simple-share-buttons-adder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Simple Share Buttons Adder
|
4 |
* Plugin URI: https://simplesharebuttons.com
|
5 |
* Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
|
6 |
-
* Version: 8.2.
|
7 |
* Author: Simple Share Buttons
|
8 |
* Author URI: https://simplesharebuttons.com
|
9 |
* License: GPLv2
|
@@ -50,9 +50,17 @@ function _simple_share_buttons_adder_php_version_text() {
|
|
50 |
|
51 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), '_simple_share_buttons_adder_add_action_links' );
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
function _simple_share_buttons_adder_add_action_links( $links ) {
|
54 |
$mylinks = array(
|
55 |
'<a href="' . admin_url( 'options-general.php?page=simple-share-buttons-adder' ) . '">Settings</a>',
|
56 |
);
|
|
|
57 |
return array_merge( $links, $mylinks );
|
58 |
}
|
3 |
* Plugin Name: Simple Share Buttons Adder
|
4 |
* Plugin URI: https://simplesharebuttons.com
|
5 |
* Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
|
6 |
+
* Version: 8.2.4
|
7 |
* Author: Simple Share Buttons
|
8 |
* Author URI: https://simplesharebuttons.com
|
9 |
* License: GPLv2
|
50 |
|
51 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), '_simple_share_buttons_adder_add_action_links' );
|
52 |
|
53 |
+
/**
|
54 |
+
* Add action links to array.
|
55 |
+
*
|
56 |
+
* @param array $links Links array.
|
57 |
+
*
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
function _simple_share_buttons_adder_add_action_links( $links ) {
|
61 |
$mylinks = array(
|
62 |
'<a href="' . admin_url( 'options-general.php?page=simple-share-buttons-adder' ) . '">Settings</a>',
|
63 |
);
|
64 |
+
|
65 |
return array_merge( $links, $mylinks );
|
66 |
}
|
templates/admin-footer.php
CHANGED
@@ -9,20 +9,22 @@
|
|
9 |
|
10 |
?>
|
11 |
</div>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
</div>
|
9 |
|
10 |
?>
|
11 |
</div>
|
12 |
+
<?php if ( empty( get_option( 'ssba-hide-review' ) ) ) : ?>
|
13 |
+
<div class="ssba-review-us">
|
14 |
+
<h3>
|
15 |
+
<?php echo esc_html__( 'Love this plugin?', 'simple-share-buttons-adder' ); ?>
|
16 |
+
<p>
|
17 |
+
<a href="https://wordpress.org/support/plugin/simple-share-buttons-adder/reviews/#new-post" target="_blank">
|
18 |
+
<?php
|
19 |
+
echo esc_html__(
|
20 |
+
'Please spread the word by leaving us a 5 star review!',
|
21 |
+
'simple-share-buttons-adder'
|
22 |
+
);
|
23 |
+
?>
|
24 |
+
</a>
|
25 |
+
</p>
|
26 |
+
<div id="close-review-us">close</div>
|
27 |
+
</h3>
|
28 |
+
</div>
|
29 |
+
<?php endif; ?>
|
30 |
</div>
|
templates/admin-header.php
CHANGED
@@ -7,8 +7,20 @@
|
|
7 |
* @package SimpleShareButtonsAdder
|
8 |
*/
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
?>
|
11 |
-
<div class="ssba-admin-wrap">
|
12 |
<nav class="navbar navbar-default">
|
13 |
<div class="container-fluid">
|
14 |
<div class="navbar-header">
|
7 |
* @package SimpleShareButtonsAdder
|
8 |
*/
|
9 |
|
10 |
+
use SimpleShareButtonsAdder\Admin_Bits;
|
11 |
+
|
12 |
+
$accept_terms = filter_input( INPUT_GET, 'accept-terms', FILTER_SANITIZE_STRING );
|
13 |
+
|
14 |
+
$arr_settings = get_option( 'ssba_settings' );
|
15 |
+
$accepted = isset( $arr_settings['accepted_sharethis_terms'] ) ? $arr_settings['accepted_sharethis_terms'] : '';
|
16 |
+
$accepted = 'Y' === $accepted || 'Y' === $accept_terms ? 'true' : 'false';
|
17 |
+
|
18 |
+
// If terms not accepted, show the notice.
|
19 |
+
if ( 'false' === $accepted ) {
|
20 |
+
Admin_Bits::sharethis_terms_notice();
|
21 |
+
}
|
22 |
?>
|
23 |
+
<div data-accepted="<?php echo esc_attr( $accepted ); ?>" class="ssba-admin-wrap">
|
24 |
<nav class="navbar navbar-default">
|
25 |
<div class="container-fluid">
|
26 |
<div class="navbar-header">
|
templates/admin-panel.php
CHANGED
@@ -9,34 +9,19 @@
|
|
9 |
|
10 |
$selected_tab = get_option( 'ssba_selected_tab' );
|
11 |
$selected_tab = null !== $selected_tab && false !== $selected_tab ? $selected_tab : 'classic';
|
12 |
-
$classic
|
13 |
-
$modern
|
14 |
-
$bar
|
15 |
-
$gdpr
|
16 |
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
?>
|
20 |
<h2><?php echo esc_html__( 'Settings', 'simple-share-buttons-adder' ); ?></h2>
|
21 |
|
22 |
-
<?php
|
23 |
-
// If terms have just been accepted.
|
24 |
-
if ( isset( $_GET['accept-terms'] ) && 'Y' === $_GET['accept-terms'] ) { // WPCS: CSRF ok. ?>
|
25 |
-
<div class="alert alert-success text-center">
|
26 |
-
<p><?php echo esc_html__( 'Thanks for accepting the terms, you can now take advantage of the great new features!', 'simple-share-buttons-adder' ); ?></p>
|
27 |
-
</div>
|
28 |
-
<?php } elseif ( 'Y' !== $arr_settings['accepted_sharethis_terms'] ) { ?>
|
29 |
-
<div class="alert alert-warning text-center">
|
30 |
-
<p>
|
31 |
-
<?php echo esc_html__( 'The Facebook save button requires acceptance of the terms before it can be used.', 'simple-share-buttons-adder' ); ?>
|
32 |
-
<a href="options-general.php?page=simple-share-buttons-adder&accept-terms=Y">
|
33 |
-
<span class="button button-secondary">
|
34 |
-
<?php echo esc_html__( 'I accept', 'simple-share-buttons-adder' ); ?>
|
35 |
-
</span>
|
36 |
-
</a>
|
37 |
-
</p>
|
38 |
-
</div>
|
39 |
-
<?php } ?>
|
40 |
<ul class="nav nav-tabs">
|
41 |
<li class="ssba-classic-tab <?php echo esc_attr( $classic ); ?>">
|
42 |
<a href="#classic-share-buttons" data-toggle="tab">
|
@@ -53,21 +38,21 @@ if ( isset( $_GET['accept-terms'] ) && 'Y' === $_GET['accept-terms'] ) { // WPCS
|
|
53 |
<?php echo esc_html__( 'Share Bar', 'simple-share-buttons-adder' ); ?>
|
54 |
</a>
|
55 |
</li>
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
</ul>
|
63 |
<div id="ssbaTabContent" class="tab-content">
|
64 |
-
<?php
|
65 |
-
<?php
|
66 |
-
<?php
|
67 |
-
|
68 |
</div>
|
69 |
<input id="ssba_selected_tab" name="ssba_selected_tab" type="hidden" value="<?php echo esc_html( $selected_tab ); ?>"/>
|
70 |
<?php
|
71 |
-
echo $this->forms->close(); //
|
72 |
-
echo $this->admin_footer(); //
|
73 |
?>
|
9 |
|
10 |
$selected_tab = get_option( 'ssba_selected_tab' );
|
11 |
$selected_tab = null !== $selected_tab && false !== $selected_tab ? $selected_tab : 'classic';
|
12 |
+
$classic = 'classic' === $selected_tab ? 'active' : '';
|
13 |
+
$modern = isset( $selected_tab ) && 'modern' === $selected_tab ? 'active' : '';
|
14 |
+
$bar = isset( $selected_tab ) && 'bar' === $selected_tab ? 'active' : '';
|
15 |
+
$gdpr = isset( $selected_tab ) && 'gdpr' === $selected_tab ? 'active' : '';
|
16 |
|
17 |
+
$accept_terms = filter_input( INPUT_GET, 'accept-terms', FILTER_SANITIZE_STRING );
|
18 |
+
$accept_terms = sanitize_text_field( wp_unslash( $accept_terms ) );
|
19 |
+
|
20 |
+
echo $this->admin_header(); // phpcs:ignore
|
21 |
+
echo $this->forms->open( false ); // phpcs:ignore
|
22 |
?>
|
23 |
<h2><?php echo esc_html__( 'Settings', 'simple-share-buttons-adder' ); ?></h2>
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<ul class="nav nav-tabs">
|
26 |
<li class="ssba-classic-tab <?php echo esc_attr( $classic ); ?>">
|
27 |
<a href="#classic-share-buttons" data-toggle="tab">
|
38 |
<?php echo esc_html__( 'Share Bar', 'simple-share-buttons-adder' ); ?>
|
39 |
</a>
|
40 |
</li>
|
41 |
+
<li class="ssba-gdpr <?php echo esc_attr( $gdpr ); ?>">
|
42 |
+
<span class="ssba-new-icon">new</span>
|
43 |
+
<a href="#gdpr" data-toggle="tab">
|
44 |
+
<?php echo esc_html__( 'GDPR', 'simple-share-buttons-adder' ); ?>
|
45 |
+
</a>
|
46 |
+
</li>
|
47 |
</ul>
|
48 |
<div id="ssbaTabContent" class="tab-content">
|
49 |
+
<?php require_once "{$this->plugin->dir_path}/templates/classic-tab.php"; ?>
|
50 |
+
<?php require_once "{$this->plugin->dir_path}/templates/plus-tab.php"; ?>
|
51 |
+
<?php require_once "{$this->plugin->dir_path}/templates/share-bar-tab.php"; ?>
|
52 |
+
<?php require_once "{$this->plugin->dir_path}/templates/gdpr-tab.php"; ?>
|
53 |
</div>
|
54 |
<input id="ssba_selected_tab" name="ssba_selected_tab" type="hidden" value="<?php echo esc_html( $selected_tab ); ?>"/>
|
55 |
<?php
|
56 |
+
echo $this->forms->close(); // phpcs:ignore
|
57 |
+
echo $this->admin_footer(); // phpcs:ignore
|
58 |
?>
|
templates/classic-tab.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
use SimpleShareButtonsAdder\Admin_Panel;
|
11 |
|
12 |
?>
|
13 |
-
<div class="tab-pane fade <?php echo 'active' === $classic ? esc_attr( $classic . ' in' ): ''; ?>" id="classic-share-buttons">
|
14 |
<div class="col-sm-12 ssba-tab-container">
|
15 |
<blockquote class="yellow">
|
16 |
<p><?php echo esc_html__( 'Dear valued SSB users,', 'simple-share-buttons-adder' ); ?></p>
|
@@ -19,7 +19,7 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
19 |
<p><?php echo esc_html__( 'We plan on moving the "Classic Share Buttons" tab within this plugin to highlight our "Modern Share Buttons." Please make the switch over to the Modern Share Buttons version as soon as possible!', 'simple-share-buttons-adder' ); ?></p>
|
20 |
<p><?php echo esc_html__( 'Thank you :)', 'simple-share-buttons-adder' ); ?></p>
|
21 |
</blockquote>
|
22 |
-
<?php if ( isset( $arr_settings['ssba_new_buttons'] ) && 'Y' === $arr_settings['ssba_new_buttons'] )
|
23 |
<blockquote class="yellow">
|
24 |
<p>
|
25 |
<?php echo esc_html__( 'The "Modern Share Buttons" are currently active. To use the buttons below you must deactivate the "Modern Share Buttons".', 'simple-share-buttons-adder' ); ?>
|
@@ -80,11 +80,11 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
80 |
<input type="hidden" name="ssba_selected_buttons" id="ssba_selected_buttons" value="<?php esc_attr( $arr_settings['ssba_selected_buttons'] ); ?>"/>
|
81 |
</div>
|
82 |
<?php
|
83 |
-
echo $this->forms->ssbp_checkboxes( $opts1 ); //
|
84 |
-
echo $this->forms->ssbp_input( $opts2 ); //
|
85 |
-
echo $this->forms->ssbp_input( $page_omit ); //
|
86 |
|
87 |
-
$line_height
|
88 |
$image_line_height = $arr_settings['ssba_size'] . 'px';
|
89 |
?>
|
90 |
|
@@ -98,10 +98,11 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
98 |
</div>
|
99 |
|
100 |
<ul class="ssbp-list">
|
101 |
-
<?php
|
|
|
102 |
$button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $buttons['full_name'] ) ) );
|
103 |
|
104 |
-
if (false === Admin_Panel::
|
105 |
continue;
|
106 |
}
|
107 |
|
@@ -109,14 +110,18 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
109 |
$img_src = esc_attr( $this->plugin->dir_url ) . 'buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/' . esc_attr( $button ) . '.png';
|
110 |
} else {
|
111 |
$img_src = isset( $custom_buttons[ $button ] ) ? $custom_buttons[ $button ] : '';
|
112 |
-
}
|
113 |
-
|
|
|
|
|
|
|
114 |
if ( ! in_array( $button, explode( ',', $arr_settings['ssba_selected_buttons'] ), true ) ) {
|
115 |
echo esc_attr( ' ssba-hide-button' );
|
116 |
}
|
117 |
-
?>
|
|
|
118 |
<img style="line-height: <?php echo esc_attr( $image_line_height ); ?>; height: <?php echo esc_attr( $arr_settings['ssba_size'] ); ?>px; padding: <?php echo esc_attr( $arr_settings['ssba_padding'] ); ?>px;" src="<?php echo esc_attr( $img_src ); ?>" title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssba ssba-img" alt="Share on <?php echo esc_attr( $button ); ?>" />
|
119 |
-
|
120 |
</li>
|
121 |
<?php endforeach; ?>
|
122 |
</ul>
|
@@ -135,7 +140,7 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
135 |
</div>
|
136 |
|
137 |
<div class="col-md-6">
|
138 |
-
<?php echo $this->forms->ssbp_input( $opts4 );
|
139 |
|
140 |
<div id="ssba-custom-images" <?php echo 'custom' !== $arr_settings['ssba_image_set'] ? 'style="display: none;"' : null; ?>>
|
141 |
<?php
|
@@ -144,7 +149,7 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
144 |
$custom_button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $arr_button['full_name'] ) ) );
|
145 |
|
146 |
// Enable custom images.
|
147 |
-
$opts5
|
148 |
'form_group' => false,
|
149 |
'type' => 'image_upload',
|
150 |
'name' => 'ssba_custom_' . $custom_button,
|
@@ -152,17 +157,17 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
152 |
'tooltip' => 'Upload a custom ' . $arr_button['full_name'] . ' image',
|
153 |
'value' => isset( $arr_settings[ 'ssba_custom_' . $custom_button ] ) ? $arr_settings[ 'ssba_custom_' . $custom_button ] : '',
|
154 |
);
|
155 |
-
echo $this->forms->ssbp_input( $opts5 );
|
156 |
}
|
157 |
?>
|
158 |
</div>
|
159 |
|
160 |
-
<?php echo $this->forms->ssbp_input( $opts6 );
|
161 |
</div>
|
162 |
<div class="col-md-6">
|
163 |
<?php
|
164 |
-
echo $this->forms->ssbp_input( $opts7 );
|
165 |
-
echo $this->forms->ssbp_input( $opts8 );
|
166 |
?>
|
167 |
</div>
|
168 |
|
@@ -171,16 +176,16 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
171 |
</div>
|
172 |
<div class="col-md-6 share-text-prev">
|
173 |
<?php
|
174 |
-
echo $this->forms->ssbp_input( $opts3 );
|
175 |
-
echo $this->forms->ssbp_input( $opts10 );
|
176 |
-
echo $this->forms->ssbp_input( $opts11 );
|
177 |
?>
|
178 |
</div>
|
179 |
<div class="col-md-6 share-text-prev">
|
180 |
<?php
|
181 |
-
echo $this->forms->ssbp_input( $opts12 );
|
182 |
-
echo $this->forms->ssbp_input( $opts13 );
|
183 |
-
echo $this->forms->ssbp_input( $opts9 );
|
184 |
?>
|
185 |
</div>
|
186 |
|
@@ -189,19 +194,19 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
189 |
</div>
|
190 |
|
191 |
<div class="col-md-12 share-cont-prev">
|
192 |
-
<?php echo $this->forms->ssbp_input( $opts18 );
|
193 |
</div>
|
194 |
|
195 |
<div class="col-md-6 share-cont-prev">
|
196 |
<?php
|
197 |
-
echo $this->forms->ssbp_input( $opts14 );
|
198 |
-
echo $this->forms->ssbp_input( $opts17 );
|
199 |
?>
|
200 |
</div>
|
201 |
<div class="col-md-6 share-cont-prev">
|
202 |
<?php
|
203 |
-
echo $this->forms->ssbp_input( $opts16 );
|
204 |
-
echo $this->forms->ssbp_input( $opts15 );
|
205 |
?>
|
206 |
</div>
|
207 |
</div>
|
@@ -220,9 +225,9 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
220 |
|
221 |
<div class="col-md-12 share-count-prev">
|
222 |
<?php
|
223 |
-
echo $this->forms->ssbp_input( $opts19 ); //
|
224 |
-
echo $this->forms->ssbp_input( $opts20 ); //
|
225 |
-
echo $this->forms->ssbp_input( $opts21 ); //
|
226 |
?>
|
227 |
</div>
|
228 |
</div>
|
@@ -261,19 +266,19 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
261 |
|
262 |
<div class="col-md-12">
|
263 |
<?php
|
264 |
-
echo $this->forms->ssbp_input( $opts26 ); //
|
265 |
-
echo $this->forms->ssbp_input( $opts27 ); //
|
266 |
-
echo $this->forms->ssbp_input( $opts28 ); //
|
267 |
-
echo $this->forms->ssbp_input( $opts29 ); //
|
268 |
?>
|
269 |
</div>
|
270 |
|
271 |
<div class="col-md-6">
|
272 |
-
<?php echo $this->forms->ssbp_input( $opts30 ); //
|
273 |
</div>
|
274 |
|
275 |
<div class="col-md-6">
|
276 |
-
<?php echo $this->forms->ssbp_input( $opts31 ); //
|
277 |
</div>
|
278 |
|
279 |
<div class="col-md-12">
|
@@ -281,11 +286,11 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
281 |
</div>
|
282 |
|
283 |
<div class="col-md-12">
|
284 |
-
<?php echo $this->forms->ssbp_input( $opts33 ); //
|
285 |
</div>
|
286 |
|
287 |
<div class="col-md-12">
|
288 |
-
<?php echo $this->forms->ssbp_input( $ignore_sdk ); //
|
289 |
</div>
|
290 |
|
291 |
<div class="col-md-12">
|
@@ -293,26 +298,26 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
293 |
</div>
|
294 |
|
295 |
<div class="col-md-12">
|
296 |
-
<?php echo $this->forms->ssbp_input( $opts32 ); //
|
297 |
</div>
|
298 |
|
299 |
<div class="col-md-6">
|
300 |
<?php
|
301 |
-
echo $this->forms->ssbp_input( $opts34 ); //
|
302 |
-
echo $this->forms->ssbp_input( $opts37 ); //
|
303 |
?>
|
304 |
</div>
|
305 |
<div class="col-md-6">
|
306 |
<?php
|
307 |
-
echo $this->forms->ssbp_input( $opts35 ); //
|
308 |
-
echo $this->forms->ssbp_input( $opts36 ); //
|
309 |
?>
|
310 |
</div>
|
311 |
|
312 |
<div class="col-md-12">
|
313 |
<?php
|
314 |
-
echo $this->forms->ssbp_input( $opts38 ); //
|
315 |
-
echo $this->forms->ssbp_input( $opts39 ); //
|
316 |
?>
|
317 |
</div>
|
318 |
</div>
|
@@ -336,7 +341,7 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
336 |
</div>
|
337 |
|
338 |
<div class="col-sm-12">
|
339 |
-
<?php echo $this->forms->ssbp_input( $opts40 ); //
|
340 |
</div>
|
341 |
|
342 |
<div class="col-md-12">
|
@@ -347,8 +352,8 @@ use SimpleShareButtonsAdder\Admin_Panel;
|
|
347 |
|
348 |
<div class="col-sm-12">
|
349 |
<?php
|
350 |
-
echo $this->forms->ssbp_input( $opts41 ); //
|
351 |
-
echo $this->forms->ssbp_input( $opts42 ); //
|
352 |
?>
|
353 |
</div>
|
354 |
</div>
|
10 |
use SimpleShareButtonsAdder\Admin_Panel;
|
11 |
|
12 |
?>
|
13 |
+
<div class="tab-pane fade <?php echo 'active' === $classic ? esc_attr( $classic . ' in' ) : ''; ?>" id="classic-share-buttons">
|
14 |
<div class="col-sm-12 ssba-tab-container">
|
15 |
<blockquote class="yellow">
|
16 |
<p><?php echo esc_html__( 'Dear valued SSB users,', 'simple-share-buttons-adder' ); ?></p>
|
19 |
<p><?php echo esc_html__( 'We plan on moving the "Classic Share Buttons" tab within this plugin to highlight our "Modern Share Buttons." Please make the switch over to the Modern Share Buttons version as soon as possible!', 'simple-share-buttons-adder' ); ?></p>
|
20 |
<p><?php echo esc_html__( 'Thank you :)', 'simple-share-buttons-adder' ); ?></p>
|
21 |
</blockquote>
|
22 |
+
<?php if ( isset( $arr_settings['ssba_new_buttons'] ) && 'Y' === $arr_settings['ssba_new_buttons'] ) : ?>
|
23 |
<blockquote class="yellow">
|
24 |
<p>
|
25 |
<?php echo esc_html__( 'The "Modern Share Buttons" are currently active. To use the buttons below you must deactivate the "Modern Share Buttons".', 'simple-share-buttons-adder' ); ?>
|
80 |
<input type="hidden" name="ssba_selected_buttons" id="ssba_selected_buttons" value="<?php esc_attr( $arr_settings['ssba_selected_buttons'] ); ?>"/>
|
81 |
</div>
|
82 |
<?php
|
83 |
+
echo $this->forms->ssbp_checkboxes( $opts1 ); // phpcs:ignore
|
84 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts2 )); // phpcs:ignore
|
85 |
+
echo wp_kses_post($this->forms->ssbp_input( $page_omit )); // phpcs:ignore
|
86 |
|
87 |
+
$line_height = 'below' === $arr_settings['ssba_text_placement'] || 'above' === $arr_settings['ssba_text_placement'] ? 'inherit' : ( (int) $arr_settings['ssba_size'] + (int) $arr_settings['ssba_padding'] + 3 ) . 'px';
|
88 |
$image_line_height = $arr_settings['ssba_size'] . 'px';
|
89 |
?>
|
90 |
|
98 |
</div>
|
99 |
|
100 |
<ul class="ssbp-list">
|
101 |
+
<?php
|
102 |
+
foreach ( $arr_buttons as $buttons ) :
|
103 |
$button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $buttons['full_name'] ) ) );
|
104 |
|
105 |
+
if ( false === Admin_Panel::show_in_classic( 'classic', $buttons['full_name'] ) ) {
|
106 |
continue;
|
107 |
}
|
108 |
|
110 |
$img_src = esc_attr( $this->plugin->dir_url ) . 'buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/' . esc_attr( $button ) . '.png';
|
111 |
} else {
|
112 |
$img_src = isset( $custom_buttons[ $button ] ) ? $custom_buttons[ $button ] : '';
|
113 |
+
}
|
114 |
+
?>
|
115 |
+
<li class="ssbp-li--
|
116 |
+
<?php
|
117 |
+
echo esc_attr( $button );
|
118 |
if ( ! in_array( $button, explode( ',', $arr_settings['ssba_selected_buttons'] ), true ) ) {
|
119 |
echo esc_attr( ' ssba-hide-button' );
|
120 |
}
|
121 |
+
?>
|
122 |
+
">
|
123 |
<img style="line-height: <?php echo esc_attr( $image_line_height ); ?>; height: <?php echo esc_attr( $arr_settings['ssba_size'] ); ?>px; padding: <?php echo esc_attr( $arr_settings['ssba_padding'] ); ?>px;" src="<?php echo esc_attr( $img_src ); ?>" title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssba ssba-img" alt="Share on <?php echo esc_attr( $button ); ?>" />
|
124 |
+
<span style="vertical-align: middle;" class="<?php echo 'Y' === $arr_settings['ssba_show_share_count'] ? esc_attr( 'ssba_sharecount ssba_' . $arr_settings['ssba_share_count_style'] ) : ''; ?> ssbp-total-<?php echo esc_attr( $button ); ?>-shares">1.8k</span>
|
125 |
</li>
|
126 |
<?php endforeach; ?>
|
127 |
</ul>
|
140 |
</div>
|
141 |
|
142 |
<div class="col-md-6">
|
143 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts4 ) ); ?>
|
144 |
|
145 |
<div id="ssba-custom-images" <?php echo 'custom' !== $arr_settings['ssba_image_set'] ? 'style="display: none;"' : null; ?>>
|
146 |
<?php
|
149 |
$custom_button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $arr_button['full_name'] ) ) );
|
150 |
|
151 |
// Enable custom images.
|
152 |
+
$opts5 = array(
|
153 |
'form_group' => false,
|
154 |
'type' => 'image_upload',
|
155 |
'name' => 'ssba_custom_' . $custom_button,
|
157 |
'tooltip' => 'Upload a custom ' . $arr_button['full_name'] . ' image',
|
158 |
'value' => isset( $arr_settings[ 'ssba_custom_' . $custom_button ] ) ? $arr_settings[ 'ssba_custom_' . $custom_button ] : '',
|
159 |
);
|
160 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts5 ) );
|
161 |
}
|
162 |
?>
|
163 |
</div>
|
164 |
|
165 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts6 ) ); ?>
|
166 |
</div>
|
167 |
<div class="col-md-6">
|
168 |
<?php
|
169 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts7 ) );
|
170 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts8 ) );
|
171 |
?>
|
172 |
</div>
|
173 |
|
176 |
</div>
|
177 |
<div class="col-md-6 share-text-prev">
|
178 |
<?php
|
179 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts3 ) );
|
180 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts10 ) );
|
181 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts11 ) );
|
182 |
?>
|
183 |
</div>
|
184 |
<div class="col-md-6 share-text-prev">
|
185 |
<?php
|
186 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts12 ) );
|
187 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts13 ) );
|
188 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts9 ) );
|
189 |
?>
|
190 |
</div>
|
191 |
|
194 |
</div>
|
195 |
|
196 |
<div class="col-md-12 share-cont-prev">
|
197 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts18 ) ); ?>
|
198 |
</div>
|
199 |
|
200 |
<div class="col-md-6 share-cont-prev">
|
201 |
<?php
|
202 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts14 ) );
|
203 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts17 ) );
|
204 |
?>
|
205 |
</div>
|
206 |
<div class="col-md-6 share-cont-prev">
|
207 |
<?php
|
208 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts16 ) );
|
209 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts15 ) );
|
210 |
?>
|
211 |
</div>
|
212 |
</div>
|
225 |
|
226 |
<div class="col-md-12 share-count-prev">
|
227 |
<?php
|
228 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts19 )); // phpcs:ignore
|
229 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts20 )); // phpcs:ignore
|
230 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts21 )); // phpcs:ignore
|
231 |
?>
|
232 |
</div>
|
233 |
</div>
|
266 |
|
267 |
<div class="col-md-12">
|
268 |
<?php
|
269 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts26 ) ); // phpcs:ignore
|
270 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts27 ) ); // phpcs:ignore
|
271 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts28 ) ); // phpcs:ignore
|
272 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts29 ) ); // phpcs:ignore
|
273 |
?>
|
274 |
</div>
|
275 |
|
276 |
<div class="col-md-6">
|
277 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts30 ) ); // phcs:ignore. ?>
|
278 |
</div>
|
279 |
|
280 |
<div class="col-md-6">
|
281 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts31 ) ); // phcs:ignore. ?>
|
282 |
</div>
|
283 |
|
284 |
<div class="col-md-12">
|
286 |
</div>
|
287 |
|
288 |
<div class="col-md-12">
|
289 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts33 ) ); // phcs:ignore. ?>
|
290 |
</div>
|
291 |
|
292 |
<div class="col-md-12">
|
293 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $ignore_sdk ) ); // phcs:ignore. ?>
|
294 |
</div>
|
295 |
|
296 |
<div class="col-md-12">
|
298 |
</div>
|
299 |
|
300 |
<div class="col-md-12">
|
301 |
+
<?php echo wp_kses_post( $this->forms->ssbp_input( $opts32 ) ); // phpcs:ignore. ?>
|
302 |
</div>
|
303 |
|
304 |
<div class="col-md-6">
|
305 |
<?php
|
306 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts34 ) ); // phpcs:ignore
|
307 |
+
echo wp_kses_post( $this->forms->ssbp_input( $opts37 ) ); // phpcs:ignore
|
308 |
?>
|
309 |
</div>
|
310 |
<div class="col-md-6">
|
311 |
<?php
|
312 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts35 )); // phpcs:ignore
|
313 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts36 )); // phpcs:ignore
|
314 |
?>
|
315 |
</div>
|
316 |
|
317 |
<div class="col-md-12">
|
318 |
<?php
|
319 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts38 )); // phpcs:ignore
|
320 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts39 )); // phpcs:ignore
|
321 |
?>
|
322 |
</div>
|
323 |
</div>
|
341 |
</div>
|
342 |
|
343 |
<div class="col-sm-12">
|
344 |
+
<?php echo wp_kses_post($this->forms->ssbp_input( $opts40 )); // phpcs:ignore ?>
|
345 |
</div>
|
346 |
|
347 |
<div class="col-md-12">
|
352 |
|
353 |
<div class="col-sm-12">
|
354 |
<?php
|
355 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts41 )); // phpcs:ignore
|
356 |
+
echo wp_kses_post($this->forms->ssbp_input( $opts42 )); // phpcs:ignore
|
357 |
?>
|
358 |
</div>
|
359 |
</div>
|
templates/config/gdpr/appearance.php
CHANGED
@@ -1,53 +1,59 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Appearence display for gdpr config.
|
|
|
|
|
4 |
*/
|
5 |
|
|
|
|
|
|
|
|
|
6 |
// Template vars.
|
7 |
-
$colors =
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
?>
|
40 |
<div class="col-md-12">
|
41 |
-
|
42 |
</div>
|
43 |
|
44 |
<div id="sharethis-form-color" class="col-md-12">
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
</div>
|
1 |
<?php
|
2 |
/**
|
3 |
* Appearence display for gdpr config.
|
4 |
+
*
|
5 |
+
* @package SimpleShareButtonsAdder
|
6 |
*/
|
7 |
|
8 |
+
// Get GDPR Config.
|
9 |
+
$ssba_settings = get_option( 'ssba_settings', true );
|
10 |
+
$gdpr_config = true === isset( $ssba_settings['ssba_gdpr_config'] ) ? $ssba_settings['ssba_gdpr_config'] : array();
|
11 |
+
|
12 |
// Template vars.
|
13 |
+
$colors = array(
|
14 |
+
'#e31010',
|
15 |
+
'#000000',
|
16 |
+
'#ffffff',
|
17 |
+
'#09cd18',
|
18 |
+
'#ff6900',
|
19 |
+
'#fcb900',
|
20 |
+
'#7bdcb5',
|
21 |
+
'#00d084',
|
22 |
+
'#8ed1fc',
|
23 |
+
'#0693e3',
|
24 |
+
'#abb8c3',
|
25 |
+
'#eb144c',
|
26 |
+
'#f78da7',
|
27 |
+
'#9900ef',
|
28 |
+
'#b80000',
|
29 |
+
'#db3e00',
|
30 |
+
'#fccb00',
|
31 |
+
'#008b02',
|
32 |
+
'#006b76',
|
33 |
+
'#1273de',
|
34 |
+
'#004dcf',
|
35 |
+
'#5300eb',
|
36 |
+
'#eb9694',
|
37 |
+
'#fad0c3',
|
38 |
+
'#fef3bd',
|
39 |
+
'#c1e1c5',
|
40 |
+
'#bedadc',
|
41 |
+
'#c4def6',
|
42 |
+
'#bed3f3',
|
43 |
+
'#d4c4fb',
|
44 |
+
);
|
45 |
?>
|
46 |
<div class="col-md-12">
|
47 |
+
<h3><?php echo esc_html__( 'Form Color', 'simple-share-buttons-adder' ); ?></h3>
|
48 |
</div>
|
49 |
|
50 |
<div id="sharethis-form-color" class="col-md-12">
|
51 |
+
<?php foreach ( $colors as $color ) : ?>
|
52 |
+
<div class="color<?php echo true === isset( $gdpr_config['color'] ) && $color === $gdpr_config['color'] ? esc_attr( ' selected' ) : ''; ?>"
|
53 |
+
data-value="<?php echo esc_attr( $color ); ?>"
|
54 |
+
style="max-width: 30px; max-height: 30px; overflow: hidden;"
|
55 |
+
>
|
56 |
+
<span style="content: ' '; background-color:<?php echo esc_html( $color ); ?>; padding: 40px;"></span>
|
57 |
+
</div>
|
58 |
+
<?php endforeach; ?>
|
59 |
</div>
|
templates/config/gdpr/config.php
CHANGED
@@ -1,83 +1,93 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* The Config display for GDPR tab.
|
|
|
|
|
4 |
*/
|
5 |
|
6 |
// User type options.
|
7 |
$user_types = array(
|
8 |
-
|
9 |
-
|
10 |
);
|
11 |
|
12 |
$languages = array(
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
);
|
18 |
|
19 |
-
$publisher_name = !empty($gdpr_config['publisher_name']) ? $gdpr_config['publisher_name'] : '';
|
20 |
-
$enabled
|
21 |
?>
|
22 |
<label class="control-label">
|
23 |
-
|
24 |
</label>
|
25 |
<div class="input-div">
|
26 |
-
|
27 |
</div>
|
28 |
<div class="well">
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
</div>
|
62 |
<div class="accor-wrap">
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
</div>
|
73 |
<div class="accor-wrap">
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
</div>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* The Config display for GDPR tab.
|
4 |
+
*
|
5 |
+
* @package SimpleShareButtonsAdder
|
6 |
*/
|
7 |
|
8 |
// User type options.
|
9 |
$user_types = array(
|
10 |
+
'eu' => esc_html__( 'Only visitors in the EU', 'sharethis-custom' ),
|
11 |
+
'always' => esc_html__( 'All visitors globally', 'sharethis-custom' ),
|
12 |
);
|
13 |
|
14 |
$languages = array(
|
15 |
+
'English' => 'en',
|
16 |
+
'German' => 'de',
|
17 |
+
'Spanish' => 'es',
|
18 |
+
'French' => 'fr',
|
19 |
);
|
20 |
|
21 |
+
$publisher_name = ! empty( $gdpr_config['publisher_name'] ) ? $gdpr_config['publisher_name'] : '';
|
22 |
+
$enabled = ! empty( $gdpr_config['enabled'] ) ? $gdpr_config['enabled'] : false;
|
23 |
?>
|
24 |
<label class="control-label">
|
25 |
+
<?php echo esc_html__( 'GDPR', 'simple-share-buttons-adder' ); ?>
|
26 |
</label>
|
27 |
<div class="input-div">
|
28 |
+
<input type="checkbox" id="sharethis-enabled" <?php checked( 'true', $enabled ); ?>>
|
29 |
</div>
|
30 |
<div class="well">
|
31 |
+
<label class="control-label">
|
32 |
+
<?php
|
33 |
+
echo esc_html__(
|
34 |
+
'PUBLISHER NAME * (this will be displayed in the consent tool)',
|
35 |
+
'sharethis-share-buttons'
|
36 |
+
);
|
37 |
+
?>
|
38 |
+
</label>
|
39 |
+
<div class="input-div">
|
40 |
+
<input type="text" id="sharethis-publisher-name" placeholder="Enter your company name" value="<?php echo esc_attr( $publisher_name ); ?>">
|
41 |
+
</div>
|
42 |
+
<label class="control-label">
|
43 |
+
<?php
|
44 |
+
echo esc_html__(
|
45 |
+
'WHICH USERS SHOULD BE ASKED FOR CONSENT?',
|
46 |
+
'sharethis-share-buttons'
|
47 |
+
);
|
48 |
+
?>
|
49 |
+
</label>
|
50 |
+
<div class="input-div">
|
51 |
+
<select id="sharethis-user-type">
|
52 |
+
<?php foreach ( $user_types as $user_value => $name ) : ?>
|
53 |
+
<option value="<?php echo esc_attr( $user_value ); ?>" <?php echo selected( $user_value, $gdpr_config['display'] ); ?>>
|
54 |
+
<?php echo esc_html( $name ); ?>
|
55 |
+
</option>
|
56 |
+
<?php endforeach; ?>
|
57 |
+
</select>
|
58 |
+
</div>
|
59 |
+
<label class="control-label">
|
60 |
+
<?php echo esc_html__( 'SELECT LANGUAGE', 'sharethis-share-buttons' ); ?>
|
61 |
+
</label>
|
62 |
+
<div class="input-div">
|
63 |
+
<select id="st-language">
|
64 |
+
<?php foreach ( $languages as $language => $code ) : ?>
|
65 |
+
<option value="<?php echo esc_attr( $code ); ?>" <?php echo selected( $code, $gdpr_config['language'] ); ?>>
|
66 |
+
<?php echo esc_html( $language ); ?>
|
67 |
+
</option>
|
68 |
+
<?php endforeach; ?>
|
69 |
+
</select>
|
70 |
+
</div>
|
71 |
</div>
|
72 |
<div class="accor-wrap">
|
73 |
+
<div class="accor-tab">
|
74 |
+
<span class="accor-arrow">►</span>
|
75 |
+
<?php echo esc_html__( 'Appearance', 'simple-share-buttons-adder' ); ?>
|
76 |
+
</div>
|
77 |
+
<div class="accor-content">
|
78 |
+
<div class="well">
|
79 |
+
<?php require plugin_dir_path( __FILE__ ) . 'appearance.php'; ?>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
</div>
|
83 |
<div class="accor-wrap">
|
84 |
+
<div class="accor-tab">
|
85 |
+
<span class="accor-arrow">►</span>
|
86 |
+
<?php echo esc_html__( 'Purposes', 'simple-share-buttons-adder' ); ?>
|
87 |
+
</div>
|
88 |
+
<div class="accor-content">
|
89 |
+
<div class="well">
|
90 |
+
<?php require plugin_dir_path( __FILE__ ) . 'purposes.php'; ?>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
</div>
|
templates/config/gdpr/landing.php
CHANGED
@@ -1,239 +1,295 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Template for GDPR landing page display.
|
|
|
|
|
4 |
*/
|
|
|
5 |
?>
|
6 |
<h2 style="text-decoration: underline;">
|
7 |
-
|
8 |
</h2>
|
9 |
<div class="row">
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
</div>
|
32 |
<div class="row">
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
</div>
|
52 |
<div class="row register-section">
|
53 |
-
|
54 |
</div>
|
55 |
<div class="row">
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
</div>
|
1 |
<?php
|
2 |
/**
|
3 |
* Template for GDPR landing page display.
|
4 |
+
*
|
5 |
+
* @package SimpleShareButtonsAdder
|
6 |
*/
|
7 |
+
|
8 |
?>
|
9 |
<h2 style="text-decoration: underline;">
|
10 |
+
<?php esc_html_e( 'Check out our new GDPR Compliance Tool!', 'simple-share-buttons-adder' ); ?>
|
11 |
</h2>
|
12 |
<div class="row">
|
13 |
+
<div class="col-md-12">
|
14 |
+
<img src="<?php echo esc_url( plugin_dir_url( __FILE__ ) . '../../../images/gdpr-ex.png' ); ?>"/>
|
15 |
+
</div>
|
16 |
+
<div class="col-md-6">
|
17 |
+
<h3><?php esc_html_e( 'Confirm Consent', 'simple-share-buttons-adder' ); ?></h3>
|
18 |
+
<p>
|
19 |
+
<?php
|
20 |
+
esc_html_e(
|
21 |
+
'A simple and streamlined way to confirm a user’s initial acceptance or rejection of cookie collection',
|
22 |
+
'simple-share-buttons-adder'
|
23 |
+
);
|
24 |
+
?>
|
25 |
+
</p>
|
26 |
+
</div>
|
27 |
+
<div class="col-md-6">
|
28 |
+
<h3><?php esc_html_e( 'Select Purpose', 'simple-share-buttons-adder' ); ?></h3>
|
29 |
+
<p>
|
30 |
+
<?php
|
31 |
+
esc_html_e(
|
32 |
+
'A transparent system of verifying the intent of collecting a user’s cookies, and giving the option to opt in or out',
|
33 |
+
'simple-share-buttons-adder'
|
34 |
+
);
|
35 |
+
?>
|
36 |
+
</p>
|
37 |
+
</div>
|
38 |
</div>
|
39 |
<div class="row">
|
40 |
+
<div class="col-md-6">
|
41 |
+
<h3><?php esc_html_e( 'Indicate Company', 'simple-share-buttons-adder' ); ?></h3>
|
42 |
+
<p>
|
43 |
+
<?php
|
44 |
+
esc_html_e(
|
45 |
+
'A comprehensive record of company-level information that allows users to monitor and control the recipients of cookie collection',
|
46 |
+
'simple-share-buttons-adder'
|
47 |
+
);
|
48 |
+
?>
|
49 |
+
</p>
|
50 |
+
</div>
|
51 |
+
<div class="col-md-6">
|
52 |
+
<h3><?php esc_html_e( 'Access Data Rights', 'simple-share-buttons-adder' ); ?></h3>
|
53 |
+
<p>
|
54 |
+
<?php
|
55 |
+
esc_html_e(
|
56 |
+
'A centralized database where users can review the latest privacy policies and information pertaining to their cookie collection',
|
57 |
+
'simple-share-buttons-adder'
|
58 |
+
);
|
59 |
+
?>
|
60 |
+
</p>
|
61 |
+
</div>
|
62 |
</div>
|
63 |
<div class="row register-section">
|
64 |
+
<button id="register-selection"><?php esc_html_e( 'Register to enable', 'simple-share-buttons-adder' ); ?></button>
|
65 |
</div>
|
66 |
<div class="row">
|
67 |
+
<h2 style="text-decoration: underline;"><?php esc_html_e( 'FAQs', 'simple-share-buttons-adder' ); ?></h2>
|
68 |
+
<div class="accor-wrap">
|
69 |
+
<div class="accor-tab">
|
70 |
+
<span class="accor-arrow">►</span>
|
71 |
+
<?php esc_html_e( 'What is GDPR?', 'simple-share-buttons-adder' ); ?>
|
72 |
+
</div>
|
73 |
+
<div class="accor-content">
|
74 |
+
<div class="well">
|
75 |
+
<?php
|
76 |
+
esc_html_e(
|
77 |
+
'GDPR (General Data Protection Regulation) is a European regulation to provide EU citizens and residents with greater control of their personal data and to streamline the rules for international businesses working in Europe. GDPR affects all companies based in the EU as well as companies anywhere in the world that handle data related to EU residents.',
|
78 |
+
'simple-share-buttons-adder'
|
79 |
+
);
|
80 |
+
?>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<div class="accor-wrap">
|
85 |
+
<div class="accor-tab">
|
86 |
+
<span class="accor-arrow">►</span>
|
87 |
+
<?php esc_html_e( 'What is “Personal Data” as it relates to GDPR?', 'simple-share-buttons-adder' ); ?>
|
88 |
+
</div>
|
89 |
+
<div class="accor-content">
|
90 |
+
<div class="well">
|
91 |
+
<?php
|
92 |
+
esc_html_e(
|
93 |
+
'Under GDPR personal data refers to any information that can directly or indirectly identify an individual. Personal information ShareThis collects includes cookies and IP addresses. We do not collect emails, addresses, phone numbers, or national ID numbers which is also considered personal information.',
|
94 |
+
'simple-share-buttons-adder'
|
95 |
+
);
|
96 |
+
?>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
<div class="accor-wrap">
|
101 |
+
<div class="accor-tab">
|
102 |
+
<span class="accor-arrow">►</span>
|
103 |
+
<?php esc_html_e( 'What is a Data Protection Officer (DPO)?', 'simple-share-buttons-adder' ); ?>
|
104 |
+
</div>
|
105 |
+
<div class="accor-content">
|
106 |
+
<div class="well">
|
107 |
+
<?php
|
108 |
+
esc_html_e(
|
109 |
+
'A DPO is required for companies that handle large scale processing of data. The DPO’s role is to monitor the company’s compliance under GDPR and to communicate with the data protection authorities. ShareThis is working with a DPO.',
|
110 |
+
'simple-share-buttons-adder'
|
111 |
+
);
|
112 |
+
?>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<div class="accor-wrap">
|
117 |
+
<div class="accor-tab">
|
118 |
+
<span class="accor-arrow">►</span>
|
119 |
+
<?php esc_html_e( 'What is a CMP?', 'simple-share-buttons-adder' ); ?>
|
120 |
+
</div>
|
121 |
+
<div class="accor-content">
|
122 |
+
<div class="well">
|
123 |
+
<?php
|
124 |
+
esc_html_e(
|
125 |
+
'A consent management platform (CMP) is a tool that collects and stores consented data as well as communicates the consent status of users and their cookies to other vendors within the CMP’s framework. It is customizable by the publisher and editable by the consumer.',
|
126 |
+
'simple-share-buttons-adder'
|
127 |
+
);
|
128 |
+
?>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
<div class="accor-wrap">
|
133 |
+
<div class="accor-tab">
|
134 |
+
<span class="accor-arrow">►</span>
|
135 |
+
<?php
|
136 |
+
esc_html_e(
|
137 |
+
'Are you a member of any self-regulating organizations? Have you any data-related certification?',
|
138 |
+
'simple-share-buttons-adder'
|
139 |
+
);
|
140 |
+
?>
|
141 |
+
</div>
|
142 |
+
<div class="accor-content">
|
143 |
+
<div class="well">
|
144 |
+
<?php
|
145 |
+
esc_html_e(
|
146 |
+
'ShareThis is a member of the IAB, NAI, and DAA in the North American markets and EDAA in Europe.',
|
147 |
+
'simple-share-buttons-adder'
|
148 |
+
);
|
149 |
+
?>
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
<div class="accor-wrap">
|
154 |
+
<div class="accor-tab">
|
155 |
+
<span class="accor-arrow">►</span>
|
156 |
+
<?php
|
157 |
+
esc_html_e(
|
158 |
+
'How do you manage requests from individuals regarding their data?',
|
159 |
+
'simple-share-buttons-adder'
|
160 |
+
);
|
161 |
+
?>
|
162 |
+
</div>
|
163 |
+
<div class="accor-content">
|
164 |
+
<div class="well">
|
165 |
+
<?php
|
166 |
+
esc_html_e(
|
167 |
+
'For consumers who wish not to have their data processed, or to request withdrawal of consent or deletion of data, our existing opt-out procedure can be found on our',
|
168 |
+
'simple-share-buttons-adder'
|
169 |
+
);
|
170 |
+
?>
|
171 |
+
<a href="https://www.sharethis.com/privacy/" target="_blank">
|
172 |
+
<?php esc_html_e( 'privacy page', 'simple-share-buttons-adder' ); ?>
|
173 |
+
</a>
|
174 |
+
<?php
|
175 |
+
esc_html_e(
|
176 |
+
' or emailed to ',
|
177 |
+
'simple-share-buttons-adder'
|
178 |
+
);
|
179 |
+
?>
|
180 |
+
<a href="mailto:privacy@sharethis.com">privacy@sharethis.com</a>.
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
</div>
|
184 |
+
<div class="accor-wrap">
|
185 |
+
<div class="accor-tab">
|
186 |
+
<span class="accor-arrow">►</span>
|
187 |
+
<?php
|
188 |
+
esc_html_e(
|
189 |
+
'How long can you keep personal data?',
|
190 |
+
'simple-share-buttons-adder'
|
191 |
+
);
|
192 |
+
?>
|
193 |
+
</div>
|
194 |
+
<div class="accor-content">
|
195 |
+
<div class="well">
|
196 |
+
<?php
|
197 |
+
esc_html_e(
|
198 |
+
'We believe Usage Data is relevant for up to 13 months so we retain that data for up to 14 months from the date of collection. Our cookies expire 13 months after they are last updated.',
|
199 |
+
'simple-share-buttons-adder'
|
200 |
+
);
|
201 |
+
?>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
</div>
|
205 |
+
<div class="accor-wrap">
|
206 |
+
<div class="accor-tab">
|
207 |
+
<span class="accor-arrow">►</span>
|
208 |
+
<?php
|
209 |
+
esc_html_e(
|
210 |
+
'What do I need to do to comply with GDPR?',
|
211 |
+
'simple-share-buttons-adder'
|
212 |
+
);
|
213 |
+
?>
|
214 |
+
</div>
|
215 |
+
<div class="accor-content">
|
216 |
+
<div class="well">
|
217 |
+
<?php
|
218 |
+
esc_html_e(
|
219 |
+
'Please review the ShareThis Terms of Use for what ShareThis expects of our publishers in order to be GDPR compliant and to continue using ShareThis tools. Included in our Terms of Use:',
|
220 |
+
'simple-share-buttons-adder'
|
221 |
+
);
|
222 |
+
?>
|
223 |
|
224 |
+
<ul class="bullets max-width">
|
225 |
+
<li>
|
226 |
+
<?php
|
227 |
+
esc_html_e(
|
228 |
+
'ShareThis expects that by maintaining our publisher tools on your website, you agree to these terms of service and will collect, process, and pass personal data on the basis of this consent.',
|
229 |
+
'simple-share-buttons-adder'
|
230 |
+
);
|
231 |
+
?>
|
232 |
+
</li>
|
233 |
+
<li>
|
234 |
+
<?php
|
235 |
+
esc_html_e(
|
236 |
+
'To receive consented data, we expect our publishers to have a GDPR compliant consent mechanism of choice on their website.',
|
237 |
+
'simple-share-buttons-adder'
|
238 |
+
);
|
239 |
+
?>
|
240 |
+
</li>
|
241 |
+
<li>
|
242 |
+
<?php
|
243 |
+
esc_html_e(
|
244 |
+
'ShareThis expects our publishers to collect, process, and transfer EU/EEA User Personal Data to ShareThis once they have solicited and obtained informed consent from each individual user.',
|
245 |
+
'simple-share-buttons-adder'
|
246 |
+
);
|
247 |
+
?>
|
248 |
+
</li>
|
249 |
+
</ul>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
<div class="accor-wrap">
|
254 |
+
<div class="accor-tab">
|
255 |
+
<span class="accor-arrow">►</span>
|
256 |
+
<?php
|
257 |
+
esc_html_e(
|
258 |
+
'If I choose to show the tool to people only in the EU, how can I check to make sure it’s working?',
|
259 |
+
'simple-share-buttons-adder'
|
260 |
+
);
|
261 |
+
?>
|
262 |
+
</div>
|
263 |
+
<div class="accor-content">
|
264 |
+
<div class="well">
|
265 |
+
<?php
|
266 |
+
esc_html_e(
|
267 |
+
'There are many free and paid VPN services that you can use to check the appearance of your site in other geographic regions.',
|
268 |
+
'simple-share-buttons-adder'
|
269 |
+
);
|
270 |
+
?>
|
271 |
+
</div>
|
272 |
+
</div>
|
273 |
+
</div>
|
274 |
+
<div class="accor-wrap">
|
275 |
+
<div class="accor-tab">
|
276 |
+
<span class="accor-arrow">►</span>
|
277 |
+
<?php
|
278 |
+
esc_html_e(
|
279 |
+
'If I use the Compliance Tool am I compliant with GDPR?',
|
280 |
+
'simple-share-buttons-adder'
|
281 |
+
);
|
282 |
+
?>
|
283 |
+
</div>
|
284 |
+
<div class="accor-content">
|
285 |
+
<div class="well">
|
286 |
+
<?php
|
287 |
+
esc_html_e(
|
288 |
+
'In order to be GDPR compliant with ShareThis, ShareThis expects a publisher to use a consumer management platform of their choosing, which can include the ShareThis GDPR Compliance Tool. Our publishers must collect, process, and transfer EU/EEA User Personal Data to ShareThis only after it has been solicited with obtained informed consent from each individual user. For general GDPR compliance, please seek legal counsel to understand how the law affects your publisher business in full.',
|
289 |
+
'simple-share-buttons-adder'
|
290 |
+
);
|
291 |
+
?>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
</div>
|
295 |
</div>
|
templates/config/gdpr/purposes.php
CHANGED
@@ -1,189 +1,216 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Purposes display for gdpr config.
|
|
|
|
|
4 |
*/
|
|
|
5 |
?>
|
6 |
<label>
|
7 |
-
|
8 |
</label>
|
9 |
|
10 |
<div id="publisher-purpose" class="switch">
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
</div>
|
1 |
<?php
|
2 |
/**
|
3 |
* Purposes display for gdpr config.
|
4 |
+
*
|
5 |
+
* @package SimpleShareButtonsAdder
|
6 |
*/
|
7 |
+
|
8 |
?>
|
9 |
<label>
|
10 |
+
<?php echo esc_html__( 'WHY ARE YOU COLLECTING CUSTOMER DATA?', 'simple-share-buttons-adder' ); ?>
|
11 |
</label>
|
12 |
|
13 |
<div id="publisher-purpose" class="switch">
|
14 |
+
<div class="empty-choices col-md-12">
|
15 |
+
<a id="see-st-choices" class="st-rc-link medium-btn col-md-6" href="#">
|
16 |
+
<?php esc_html_e( 'See Suggested Choices', 'simple-share-buttons-adder' ); ?>
|
17 |
+
</a>
|
18 |
+
<a id="clear-choices" class="st-rc-link medium-btn col-md-6" href="#">
|
19 |
+
<?php esc_html_e( 'Clear Choices', 'simple-share-buttons-adder' ); ?>
|
20 |
+
</a>
|
21 |
+
</div>
|
22 |
+
<div class="purpose-item">
|
23 |
+
<div class="title">
|
24 |
+
<?php
|
25 |
+
echo esc_html__(
|
26 |
+
'1) Store and/or access information on a device (Do you collect information on users on your site through cookies or site identifiers?)',
|
27 |
+
'simple-share-buttons-adder'
|
28 |
+
);
|
29 |
+
?>
|
30 |
+
</div>
|
31 |
+
<label>
|
32 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
33 |
+
<input data-id="1" type="checkbox" name="purposes[1]" value="consent" checked/>
|
34 |
+
</label>
|
35 |
+
</div>
|
36 |
+
<div class="purpose-item">
|
37 |
+
<div class="title">
|
38 |
+
<?php
|
39 |
+
echo esc_html__(
|
40 |
+
'2) Select basic ads (Do you serve ads on your site?)',
|
41 |
+
'simple-share-buttons-adder'
|
42 |
+
);
|
43 |
+
?>
|
44 |
+
</div>
|
45 |
+
<label>
|
46 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
47 |
+
<input data-id="2" type="radio" name="purposes[2]" value="consent"/>
|
48 |
+
<span class="lever"></span>
|
49 |
+
</label>
|
50 |
+
<label>
|
51 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
52 |
+
<input data-id="2" type="radio" name="purposes[2]" value="legitimate"/>
|
53 |
+
<span class="lever"></span>
|
54 |
+
</label>
|
55 |
+
</div>
|
56 |
+
<div class="purpose-item">
|
57 |
+
<div class="title">
|
58 |
+
<?php
|
59 |
+
echo esc_html__(
|
60 |
+
'3) Create a personalised ads profile (Do you create personalised advertising profiles associated with users on your site (ie: profiles based on demographic information, location, user’s activity)?)',
|
61 |
+
'simple-share-buttons-adder'
|
62 |
+
);
|
63 |
+
?>
|
64 |
+
</div>
|
65 |
+
<label>
|
66 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
67 |
+
<input data-id="3" type="radio" name="purposes[3]" value="consent" checked/>
|
68 |
+
<span class="lever"></span>
|
69 |
+
</label>
|
70 |
+
<label>
|
71 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
72 |
+
<input data-id="3" type="radio" name="purposes[3]" value="legitimate"/>
|
73 |
+
<span class="lever"></span>
|
74 |
+
</label>
|
75 |
+
</div>
|
76 |
+
<div class="purpose-item">
|
77 |
+
<div class="title">
|
78 |
+
<?php
|
79 |
+
echo esc_html__(
|
80 |
+
'4) Select personalised ads (Do you show ads to users based on this user profile)',
|
81 |
+
'simple-share-buttons-adder'
|
82 |
+
);
|
83 |
+
?>
|
84 |
+
</div>
|
85 |
+
<label>
|
86 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
87 |
+
<input data-id="4" type="radio" name="purposes[4]" value="consent"/>
|
88 |
+
<span class="lever"></span>
|
89 |
+
</label>
|
90 |
+
<label>
|
91 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
92 |
+
<input data-id="4" type="radio" name="purposes[4]" value="legitimate"/>
|
93 |
+
<span class="lever"></span>
|
94 |
+
</label>
|
95 |
+
</div>
|
96 |
+
<div class="purpose-item">
|
97 |
+
<div class="title">
|
98 |
+
<?php
|
99 |
+
echo esc_html__(
|
100 |
+
'5) Create a personalised content profile (Do you build a personalized content profile associated with users on your site based on the type of content they have viewed?)',
|
101 |
+
'simple-share-buttons-adder'
|
102 |
+
);
|
103 |
+
?>
|
104 |
+
</div>
|
105 |
+
<label>
|
106 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
107 |
+
<input data-id="5" type="radio" name="purposes[5]" value="consent" checked />
|
108 |
+
<span class="lever"></span>
|
109 |
+
</label>
|
110 |
+
<label>
|
111 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
112 |
+
<input data-id="5" type="radio" name="purposes[5]" value="legitimate"/>
|
113 |
+
<span class="lever"></span>
|
114 |
+
</label>
|
115 |
+
</div>
|
116 |
+
<div class="purpose-item">
|
117 |
+
<div class="title">
|
118 |
+
<?php
|
119 |
+
echo esc_html__(
|
120 |
+
'6) Select personalised content (Do you serve content to the user on your site based on your recorded content interests)',
|
121 |
+
'simple-share-buttons-adder'
|
122 |
+
);
|
123 |
+
?>
|
124 |
+
</div>
|
125 |
+
<label>
|
126 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
127 |
+
<input data-id="6" type="radio" name="purposes[6]" value="consent" checked />
|
128 |
+
<span class="lever"></span>
|
129 |
+
</label>
|
130 |
+
<label>
|
131 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
132 |
+
<input data-id="6" type="radio" name="purposes[6]" value="legitimate"/>
|
133 |
+
<span class="lever"></span>
|
134 |
+
</label>
|
135 |
+
</div>
|
136 |
+
<div class="purpose-item">
|
137 |
+
<div class="title">
|
138 |
+
<?php
|
139 |
+
echo esc_html__(
|
140 |
+
'7) Measure ad performance (Do you measure the performance of advertisements on your site)',
|
141 |
+
'simple-share-buttons-adder'
|
142 |
+
);
|
143 |
+
?>
|
144 |
+
</div>
|
145 |
+
<label>
|
146 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
147 |
+
<input data-id="7" type="radio" name="purposes[7]" value="consent"/>
|
148 |
+
<span class="lever"></span>
|
149 |
+
</label>
|
150 |
+
<label>
|
151 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
152 |
+
<input data-id="7" type="radio" name="purposes[7]" value="legitimate"/>
|
153 |
+
<span class="lever"></span>
|
154 |
+
</label>
|
155 |
+
</div>
|
156 |
+
<div class="purpose-item">
|
157 |
+
<div class="title">
|
158 |
+
<?php
|
159 |
+
echo esc_html__(
|
160 |
+
'8) Measure content performance (Do you measure the performance of content served to your site visitors?)',
|
161 |
+
'simple-share-buttons-adder'
|
162 |
+
);
|
163 |
+
?>
|
164 |
+
</div>
|
165 |
+
<label>
|
166 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
167 |
+
<input data-id="8" type="radio" name="purposes[8]" value="consent"/>
|
168 |
+
<span class="lever"></span>
|
169 |
+
</label>
|
170 |
+
<label>
|
171 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
172 |
+
<input data-id="8" type="radio" name="purposes[8]" value="legitimate"/>
|
173 |
+
<span class="lever"></span>
|
174 |
+
</label>
|
175 |
+
</div>
|
176 |
+
<div class="purpose-item">
|
177 |
+
<div class="title">
|
178 |
+
<?php
|
179 |
+
echo esc_html__(
|
180 |
+
'9) Apply market research to generate audience insights (Do you aggregate reporting on the ads or content show to your site visitors to advertisers)',
|
181 |
+
'simple-share-buttons-adder'
|
182 |
+
);
|
183 |
+
?>
|
184 |
+
</div>
|
185 |
+
<label>
|
186 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
187 |
+
<input data-id="9" type="radio" name="purposes[9]" value="consent"/>
|
188 |
+
<span class="lever"></span>
|
189 |
+
</label>
|
190 |
+
<label>
|
191 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
192 |
+
<input data-id="9" type="radio" name="purposes[9]" value="legitimate" checked />
|
193 |
+
<span class="lever"></span>
|
194 |
+
</label>
|
195 |
+
</div>
|
196 |
+
<div class="purpose-item">
|
197 |
+
<div class="title">
|
198 |
+
<?php
|
199 |
+
echo esc_html__(
|
200 |
+
'10) Develop and improve products (Do you use data collected on your site visitors to improve your systems or software or create new products?)',
|
201 |
+
'simple-share-buttons-adder'
|
202 |
+
);
|
203 |
+
?>
|
204 |
+
</div>
|
205 |
+
<label>
|
206 |
+
<?php echo esc_html__( 'Consent', 'simple-share-buttons-adder' ); ?>
|
207 |
+
<input data-id="10" type="radio" name="purposes[10]" value="consent"/>
|
208 |
+
<span class="lever"></span>
|
209 |
+
</label>
|
210 |
+
<label>
|
211 |
+
<?php echo esc_html__( 'Legitimate Interest', 'simple-share-buttons-adder' ); ?>
|
212 |
+
<input data-id="10" type="radio" name="purposes[10]" value="legitimate" checked/>
|
213 |
+
<span class="lever"></span>
|
214 |
+
</label>
|
215 |
+
</div>
|
216 |
</div>
|
templates/config/gdpr/register.php
CHANGED
@@ -1,39 +1,44 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Create account section of GDPR tab.
|
|
|
|
|
4 |
*/
|
5 |
|
6 |
?>
|
7 |
<h3>
|
8 |
-
|
9 |
</h3>
|
10 |
|
11 |
<div class="sharethis-account-creation">
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
</div>
|
1 |
<?php
|
2 |
/**
|
3 |
* Create account section of GDPR tab.
|
4 |
+
*
|
5 |
+
* @package SimpleShareButtonsAdder
|
6 |
*/
|
7 |
|
8 |
?>
|
9 |
<h3>
|
10 |
+
<?php echo esc_html__( 'Create an account', 'sharethis-custom' ); ?>
|
11 |
</h3>
|
12 |
|
13 |
<div class="sharethis-account-creation">
|
14 |
+
<div class="page-content" data-size="small" style="text-align: left;">
|
15 |
+
<div class="input">
|
16 |
+
<input type="text" id="st-email" name="email" placeholder="john@acme.com">
|
17 |
+
</div>
|
18 |
+
<div class="input " style="margin-bottom: 10px;">
|
19 |
+
<input type="password" id="st-password" name="password" minlength="6"
|
20 |
+
placeholder="Create a password">
|
21 |
+
</div>
|
22 |
+
<div style="margin: 20px 0 50px;" class="item gdpr-check">
|
23 |
+
<input id="email-enabled" type="checkbox"/>
|
24 |
+
<label class="gdpr">
|
25 |
+
<?php echo esc_html__( 'Subscribe to our monthly newsletter for tips and trends to grow your site.', 'sharethis-custom' ); ?>
|
26 |
+
</label>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
<div class="sharethis-login-message">
|
30 |
+
<p style="font-size:.9rem;">
|
31 |
+
<?php echo esc_html__( 'By clicking "Register," you certify that you are agreeing to our', 'sharethis-custom' ); ?>
|
32 |
+
<a href="/privacy/" target="_blank" rel="nofollow">
|
33 |
+
<?php esc_html_e( 'Privacy Policy', 'simple-share-buttons-adder' ); ?></a>
|
34 |
+
<?php esc_html_e( 'and', 'simple-share-buttons-adder' ); ?> <a
|
35 |
+
href="/publisher-terms-of-use/" target="_blank" rel="nofollow">
|
36 |
+
<?php esc_html_e( 'Terms of Service', 'simple-share-buttons-adder' ); ?></a>
|
37 |
+
<?php esc_html_e( 'for Publishers', 'simple-share-buttons-adder' ); ?>.
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
|
41 |
+
<a class="create-account st-rc-link medium-btn" href="#">
|
42 |
+
<?php esc_html_e( 'Register', 'sharethis' ); ?>
|
43 |
+
</a>
|
44 |
</div>
|
templates/gdpr-tab.php
CHANGED
@@ -7,29 +7,38 @@
|
|
7 |
* @package SimpleShareButtonsAdder
|
8 |
*/
|
9 |
|
10 |
-
$propertyid
|
11 |
-
$ssba_settings = get_option('ssba_settings', true);
|
12 |
-
$gdpr_config
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
?>
|
16 |
-
<div class="tab-pane gdpr-platform fade <?php echo 'active' === $gdpr ? esc_attr($gdpr . ' in'): ''; ?>" id="gdpr">
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
</div>
|
7 |
* @package SimpleShareButtonsAdder
|
8 |
*/
|
9 |
|
10 |
+
$propertyid = get_option( 'ssba_property_id' );
|
11 |
+
$ssba_settings = get_option( 'ssba_settings', true );
|
12 |
+
$gdpr_config = true === isset( $ssba_settings['ssba_gdpr_config'] ) ? $ssba_settings['ssba_gdpr_config'] : array();
|
13 |
+
|
14 |
+
if ( false === is_array( $gdpr_config ) ) {
|
15 |
+
$gdpr_config = array(
|
16 |
+
'enabled' => false,
|
17 |
+
'color' => '',
|
18 |
+
'display' => '',
|
19 |
+
'language' => '',
|
20 |
+
'publisher_name' => '',
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
?>
|
25 |
+
<div class="tab-pane gdpr-platform fade <?php echo 'active' === $gdpr ? esc_attr( $gdpr . ' in' ) : ''; ?>" id="gdpr">
|
26 |
+
<div class="col-sm-12 ssba-tab-container">
|
27 |
+
<?php if ( empty( $propertyid ) ) : ?>
|
28 |
+
<div class="gdpr-landing">
|
29 |
+
<?php include plugin_dir_path( __FILE__ ) . 'config/gdpr/landing.php'; ?>
|
30 |
+
</div>
|
31 |
+
<div style="display:none;" class="gdpr-register">
|
32 |
+
<?php include plugin_dir_path( __FILE__ ) . 'config/gdpr/register.php'; ?>
|
33 |
+
</div>
|
34 |
+
<?php endif; ?>
|
35 |
+
<div
|
36 |
+
<?php if ( empty( $propertyid ) ) : ?>
|
37 |
+
style="display:none;"
|
38 |
+
<?php endif; ?>
|
39 |
+
class="gdpr-config"
|
40 |
+
>
|
41 |
+
<?php require plugin_dir_path( __FILE__ ) . 'config/gdpr/config.php'; ?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
</div>
|
templates/plus-tab.php
CHANGED
@@ -8,9 +8,9 @@
|
|
8 |
*/
|
9 |
|
10 |
?>
|
11 |
-
<div class="tab-pane fade <?php echo 'active' === $modern ? esc_attr( $modern . ' in' ): ''; ?>" id="plus-share-buttons">
|
12 |
<div class="col-sm-12 ssba-tab-container">
|
13 |
-
<?php echo $this->forms->ssbp_input( $opts43 ); //
|
14 |
|
15 |
<blockquote>
|
16 |
<p>
|
@@ -33,19 +33,23 @@
|
|
33 |
</div>
|
34 |
|
35 |
<ul class="ssbp-list">
|
36 |
-
<?php if ( is_array( $arr_plus_buttons ) ) : ?>
|
37 |
-
|
38 |
-
|
|
|
|
|
39 |
|
40 |
-
<li style="margin-left: <?php echo esc_attr( $arr_settings['ssba_plus_margin'] ); ?>px;" class="ssbp-li--<?php echo esc_attr( $button );
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
45 |
<a href="#" class="ssbp-btn ssbp-<?php echo esc_attr( $button ); ?>" style="height: <?php echo esc_attr( $arr_settings['ssba_plus_height'] ); ?>px; width: <?php echo esc_attr( $arr_settings['ssba_plus_width'] ); ?>px; <?php echo '' !== $arr_settings['ssba_plus_button_color'] ? esc_attr( 'background: ' . $arr_settings['ssba_plus_button_color'] . ';' ) : ''; ?>"><div title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssbp-text"><?php echo esc_html( $buttons['full_name'] ); ?></div></a>
|
46 |
<span class="<?php echo 'Y' !== $arr_settings['ssba_plus_show_share_count'] ? esc_attr( 'ssba-hide-button' ) : ''; ?> ssbp-each-share">1.8k</span>
|
47 |
</li>
|
48 |
-
|
49 |
<?php endif; ?>
|
50 |
</ul>
|
51 |
</div>
|
@@ -86,9 +90,9 @@
|
|
86 |
<input type="hidden" name="ssba_selected_plus_buttons" id="ssba_selected_plus_buttons" value="<?php esc_attr( $arr_settings['ssba_selected_plus_buttons'] ); ?>"/>
|
87 |
|
88 |
<?php
|
89 |
-
echo $this->forms->ssbp_checkboxes( $opts48 ); //
|
90 |
-
echo $this->forms->ssbp_input( $opts49 ); //
|
91 |
-
echo $this->forms->ssbp_input( $page_omit_plus ); //
|
92 |
?>
|
93 |
|
94 |
<div class="accor-wrap">
|
@@ -103,10 +107,10 @@
|
|
103 |
</div>
|
104 |
|
105 |
<div class="col-md-6">
|
106 |
-
<?php echo $this->forms->ssbp_input( $opts44 ); //
|
107 |
</div>
|
108 |
<div class="col-md-6">
|
109 |
-
<?php echo $this->forms->ssbp_input( $opts7p ); //
|
110 |
</div>
|
111 |
|
112 |
<div class="col-md-12">
|
@@ -114,12 +118,12 @@
|
|
114 |
</div>
|
115 |
|
116 |
<div class="col-md-6">
|
117 |
-
<?php echo $this->forms->ssbp_input( $plus_height ); //
|
118 |
-
<?php echo $this->forms->ssbp_input( $plus_width ); //
|
119 |
</div>
|
120 |
<div class="col-md-6">
|
121 |
-
<?php echo $this->forms->ssbp_input( $plus_icon_size ); //
|
122 |
-
<?php echo $this->forms->ssbp_input( $plus_margin ); //
|
123 |
</div>
|
124 |
|
125 |
<div class="col-md-12">
|
@@ -127,12 +131,12 @@
|
|
127 |
</div>
|
128 |
|
129 |
<div class="col-md-6">
|
130 |
-
<?php echo $this->forms->ssbp_input( $plus_button_color ); //
|
131 |
-
<?php echo $this->forms->ssbp_input( $plus_hover_color ); //
|
132 |
</div>
|
133 |
<div class="col-md-6">
|
134 |
-
<?php echo $this->forms->ssbp_input( $plus_icon_color ); //
|
135 |
-
<?php echo $this->forms->ssbp_input( $plus_icon_hover_color ); //
|
136 |
</div>
|
137 |
|
138 |
<div class="col-md-12">
|
@@ -140,16 +144,16 @@
|
|
140 |
</div>
|
141 |
<div class="col-md-6 share-text-prev">
|
142 |
<?php
|
143 |
-
echo $this->forms->ssbp_input( $opts3p ); //
|
144 |
-
echo $this->forms->ssbp_input( $opts10p ); //
|
145 |
-
echo $this->forms->ssbp_input( $opts11p ); //
|
146 |
?>
|
147 |
</div>
|
148 |
<div class="col-md-6 share-text-prev">
|
149 |
<?php
|
150 |
-
echo $this->forms->ssbp_input( $opts12p ); //
|
151 |
-
echo $this->forms->ssbp_input( $opts13p ); //
|
152 |
-
echo $this->forms->ssbp_input( $opts9p ); //
|
153 |
?>
|
154 |
</div>
|
155 |
</div>
|
@@ -168,8 +172,8 @@
|
|
168 |
|
169 |
<div class="col-md-12 share-count-prev">
|
170 |
<?php
|
171 |
-
echo $this->forms->ssbp_input( $opts19p ); //
|
172 |
-
echo $this->forms->ssbp_input( $opts20p ); //
|
173 |
?>
|
174 |
</div>
|
175 |
</div>
|
@@ -188,18 +192,18 @@
|
|
188 |
|
189 |
<div class="col-md-12">
|
190 |
<?php
|
191 |
-
echo $this->forms->ssbp_input( $opts26p ); //
|
192 |
-
echo $this->forms->ssbp_input( $opts28p ); //
|
193 |
-
echo $this->forms->ssbp_input( $opts29p ); //
|
194 |
?>
|
195 |
</div>
|
196 |
|
197 |
<div class="col-md-6">
|
198 |
-
<?php echo $this->forms->ssbp_input( $opts30p ); //
|
199 |
</div>
|
200 |
|
201 |
<div class="col-md-6">
|
202 |
-
<?php echo $this->forms->ssbp_input( $opts31p ); //
|
203 |
</div>
|
204 |
|
205 |
<div class="col-md-12">
|
@@ -207,11 +211,11 @@
|
|
207 |
</div>
|
208 |
|
209 |
<div class="col-md-12">
|
210 |
-
<?php echo $this->forms->ssbp_input( $opts33p ); //
|
211 |
</div>
|
212 |
|
213 |
<div class="col-md-12">
|
214 |
-
<?php echo $this->forms->ssbp_input( $plus_ignore_sdk ); //
|
215 |
</div>
|
216 |
|
217 |
<div class="col-md-12">
|
@@ -219,26 +223,26 @@
|
|
219 |
</div>
|
220 |
|
221 |
<div class="col-md-12">
|
222 |
-
<?php echo $this->forms->ssbp_input( $opts32p ); //
|
223 |
</div>
|
224 |
|
225 |
<div class="col-md-6">
|
226 |
<?php
|
227 |
-
echo $this->forms->ssbp_input( $opts34p ); //
|
228 |
-
echo $this->forms->ssbp_input( $opts37p ); //
|
229 |
?>
|
230 |
</div>
|
231 |
<div class="col-md-6">
|
232 |
<?php
|
233 |
-
echo $this->forms->ssbp_input( $opts35p ); //
|
234 |
-
echo $this->forms->ssbp_input( $opts36p ); //
|
235 |
?>
|
236 |
</div>
|
237 |
|
238 |
<div class="col-md-12">
|
239 |
<?php
|
240 |
-
echo $this->forms->ssbp_input( $opts38p ); //
|
241 |
-
echo $this->forms->ssbp_input( $opts39p ); //
|
242 |
?>
|
243 |
</div>
|
244 |
</div>
|
@@ -262,7 +266,7 @@
|
|
262 |
</div>
|
263 |
|
264 |
<div class="col-sm-12">
|
265 |
-
<?php echo $this->forms->ssbp_input( $opts40p ); //
|
266 |
</div>
|
267 |
</div>
|
268 |
</div>
|
8 |
*/
|
9 |
|
10 |
?>
|
11 |
+
<div class="tab-pane fade <?php echo 'active' === $modern ? esc_attr( $modern . ' in' ) : ''; ?>" id="plus-share-buttons">
|
12 |
<div class="col-sm-12 ssba-tab-container">
|
13 |
+
<?php echo $this->forms->ssbp_input( $opts43 ); // phpcs:ignore ?>
|
14 |
|
15 |
<blockquote>
|
16 |
<p>
|
33 |
</div>
|
34 |
|
35 |
<ul class="ssbp-list">
|
36 |
+
<?php if ( true === is_array( $arr_plus_buttons ) ) : ?>
|
37 |
+
<?php
|
38 |
+
foreach ( $arr_plus_buttons as $buttons ) :
|
39 |
+
$button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $buttons['full_name'] ) ) );
|
40 |
+
?>
|
41 |
|
42 |
+
<li style="margin-left: <?php echo esc_attr( $arr_settings['ssba_plus_margin'] ); ?>px;" class="ssbp-li--<?php echo esc_attr( $button ); ?>
|
43 |
+
<?php
|
44 |
+
if ( false === in_array( $button, explode( ',', $arr_settings['ssba_selected_plus_buttons'] ), true ) ) {
|
45 |
+
echo esc_attr( ' ssba-hide-button' );
|
46 |
+
}
|
47 |
+
?>
|
48 |
+
">
|
49 |
<a href="#" class="ssbp-btn ssbp-<?php echo esc_attr( $button ); ?>" style="height: <?php echo esc_attr( $arr_settings['ssba_plus_height'] ); ?>px; width: <?php echo esc_attr( $arr_settings['ssba_plus_width'] ); ?>px; <?php echo '' !== $arr_settings['ssba_plus_button_color'] ? esc_attr( 'background: ' . $arr_settings['ssba_plus_button_color'] . ';' ) : ''; ?>"><div title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssbp-text"><?php echo esc_html( $buttons['full_name'] ); ?></div></a>
|
50 |
<span class="<?php echo 'Y' !== $arr_settings['ssba_plus_show_share_count'] ? esc_attr( 'ssba-hide-button' ) : ''; ?> ssbp-each-share">1.8k</span>
|
51 |
</li>
|
52 |
+
<?php endforeach; ?>
|
53 |
<?php endif; ?>
|
54 |
</ul>
|
55 |
</div>
|
90 |
<input type="hidden" name="ssba_selected_plus_buttons" id="ssba_selected_plus_buttons" value="<?php esc_attr( $arr_settings['ssba_selected_plus_buttons'] ); ?>"/>
|
91 |
|
92 |
<?php
|
93 |
+
echo $this->forms->ssbp_checkboxes( $opts48 ); // phpcs:ignore
|
94 |
+
echo $this->forms->ssbp_input( $opts49 ); // phpcs:ignore
|
95 |
+
echo $this->forms->ssbp_input( $page_omit_plus ); // phpcs:ignore
|
96 |
?>
|
97 |
|
98 |
<div class="accor-wrap">
|
107 |
</div>
|
108 |
|
109 |
<div class="col-md-6">
|
110 |
+
<?php echo $this->forms->ssbp_input( $opts44 ); // phpcs:ignore ?>
|
111 |
</div>
|
112 |
<div class="col-md-6">
|
113 |
+
<?php echo $this->forms->ssbp_input( $opts7p ); // phpcs:ignore ?>
|
114 |
</div>
|
115 |
|
116 |
<div class="col-md-12">
|
118 |
</div>
|
119 |
|
120 |
<div class="col-md-6">
|
121 |
+
<?php echo $this->forms->ssbp_input( $plus_height ); // phpcs:ignore ?>
|
122 |
+
<?php echo $this->forms->ssbp_input( $plus_width ); // phpcs:ignore ?>
|
123 |
</div>
|
124 |
<div class="col-md-6">
|
125 |
+
<?php echo $this->forms->ssbp_input( $plus_icon_size ); // phpcs:ignore ?>
|
126 |
+
<?php echo $this->forms->ssbp_input( $plus_margin ); // phpcs:ignore ?>
|
127 |
</div>
|
128 |
|
129 |
<div class="col-md-12">
|
131 |
</div>
|
132 |
|
133 |
<div class="col-md-6">
|
134 |
+
<?php echo $this->forms->ssbp_input( $plus_button_color ); // phpcs:ignore ?>
|
135 |
+
<?php echo $this->forms->ssbp_input( $plus_hover_color ); // phpcs:ignore ?>
|
136 |
</div>
|
137 |
<div class="col-md-6">
|
138 |
+
<?php echo $this->forms->ssbp_input( $plus_icon_color ); // phpcs:ignore ?>
|
139 |
+
<?php echo $this->forms->ssbp_input( $plus_icon_hover_color ); // phpcs:ignore ?>
|
140 |
</div>
|
141 |
|
142 |
<div class="col-md-12">
|
144 |
</div>
|
145 |
<div class="col-md-6 share-text-prev">
|
146 |
<?php
|
147 |
+
echo $this->forms->ssbp_input( $opts3p ); // phpcs:ignore
|
148 |
+
echo $this->forms->ssbp_input( $opts10p ); // phpcs:ignore
|
149 |
+
echo $this->forms->ssbp_input( $opts11p ); // phpcs:ignore
|
150 |
?>
|
151 |
</div>
|
152 |
<div class="col-md-6 share-text-prev">
|
153 |
<?php
|
154 |
+
echo $this->forms->ssbp_input( $opts12p ); // phpcs:ignore
|
155 |
+
echo $this->forms->ssbp_input( $opts13p ); // phpcs:ignore
|
156 |
+
echo $this->forms->ssbp_input( $opts9p ); // phpcs:ignore
|
157 |
?>
|
158 |
</div>
|
159 |
</div>
|
172 |
|
173 |
<div class="col-md-12 share-count-prev">
|
174 |
<?php
|
175 |
+
echo $this->forms->ssbp_input( $opts19p ); // phpcs:ignore
|
176 |
+
echo $this->forms->ssbp_input( $opts20p ); // phpcs:ignore
|
177 |
?>
|
178 |
</div>
|
179 |
</div>
|
192 |
|
193 |
<div class="col-md-12">
|
194 |
<?php
|
195 |
+
echo $this->forms->ssbp_input( $opts26p ); // phpcs:ignore
|
196 |
+
echo $this->forms->ssbp_input( $opts28p ); // phpcs:ignore
|
197 |
+
echo $this->forms->ssbp_input( $opts29p ); // phpcs:ignore
|
198 |
?>
|
199 |
</div>
|
200 |
|
201 |
<div class="col-md-6">
|
202 |
+
<?php echo $this->forms->ssbp_input( $opts30p ); // phpcs:ignore ?>
|
203 |
</div>
|
204 |
|
205 |
<div class="col-md-6">
|
206 |
+
<?php echo $this->forms->ssbp_input( $opts31p ); // phpcs:ignore ?>
|
207 |
</div>
|
208 |
|
209 |
<div class="col-md-12">
|
211 |
</div>
|
212 |
|
213 |
<div class="col-md-12">
|
214 |
+
<?php echo $this->forms->ssbp_input( $opts33p ); // phpcs:ignore ?>
|
215 |
</div>
|
216 |
|
217 |
<div class="col-md-12">
|
218 |
+
<?php echo $this->forms->ssbp_input( $plus_ignore_sdk ); // phpcs:ignore ?>
|
219 |
</div>
|
220 |
|
221 |
<div class="col-md-12">
|
223 |
</div>
|
224 |
|
225 |
<div class="col-md-12">
|
226 |
+
<?php echo $this->forms->ssbp_input( $opts32p ); // phpcs:ignore ?>
|
227 |
</div>
|
228 |
|
229 |
<div class="col-md-6">
|
230 |
<?php
|
231 |
+
echo $this->forms->ssbp_input( $opts34p ); // phpcs:ignore
|
232 |
+
echo $this->forms->ssbp_input( $opts37p ); // phpcs:ignore
|
233 |
?>
|
234 |
</div>
|
235 |
<div class="col-md-6">
|
236 |
<?php
|
237 |
+
echo $this->forms->ssbp_input( $opts35p ); // phpcs:ignore
|
238 |
+
echo $this->forms->ssbp_input( $opts36p ); // phpcs:ignore
|
239 |
?>
|
240 |
</div>
|
241 |
|
242 |
<div class="col-md-12">
|
243 |
<?php
|
244 |
+
echo $this->forms->ssbp_input( $opts38p ); // phpcs:ignore
|
245 |
+
echo $this->forms->ssbp_input( $opts39p ); // phpcs:ignore
|
246 |
?>
|
247 |
</div>
|
248 |
</div>
|
266 |
</div>
|
267 |
|
268 |
<div class="col-sm-12">
|
269 |
+
<?php echo $this->forms->ssbp_input( $opts40p ); // phpcs:ignore ?>
|
270 |
</div>
|
271 |
</div>
|
272 |
</div>
|
templates/share-bar-tab.php
CHANGED
@@ -4,13 +4,15 @@
|
|
4 |
*
|
5 |
* The template wrapper for the share bar tab.
|
6 |
*
|
|
|
|
|
7 |
* @package SimpleShareButtonsAdder
|
8 |
*/
|
9 |
|
10 |
?>
|
11 |
-
<div class="tab-pane fade <?php echo 'active' === $bar ? esc_attr( $bar . ' in' ): ''; ?>" id="share-bar">
|
12 |
<div class="col-sm-12 ssba-tab-container">
|
13 |
-
<?php echo $this->forms->ssbp_input( $share_bar ); //
|
14 |
|
15 |
<blockquote>
|
16 |
<p>
|
@@ -24,12 +26,21 @@
|
|
24 |
<div class="ssbp-wrap ssbp--centred ssbp--theme-4">
|
25 |
<div class="ssbp-container">
|
26 |
<ul id="ssbasort3" class="ssbp-list ssbaSortable">
|
27 |
-
<?php
|
28 |
-
|
|
|
|
|
|
|
29 |
)
|
30 |
);
|
31 |
|
32 |
-
echo wp_kses_post(
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
</ul>
|
34 |
</div>
|
35 |
</div>
|
@@ -60,13 +71,17 @@
|
|
60 |
<div class="ssbp-container">
|
61 |
<ul class="ssbp-list">
|
62 |
<?php if ( is_array( $arr_bar_buttons ) ) : ?>
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
<a href="#" class="ssbp-btn ssbp-<?php echo esc_attr( $button ); ?>" style="height: <?php echo esc_attr( $arr_settings['ssba_bar_height'] ); ?>px; width: <?php echo esc_attr( $arr_settings['ssba_bar_width'] ); ?>px; <?php echo '' !== $arr_settings['ssba_bar_button_color'] ? esc_attr( 'background: ' . $arr_settings['ssba_bar_button_color'] . ';' ) : ''; ?>">
|
71 |
<div title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssbp-text">
|
72 |
<?php echo esc_html( $buttons['full_name'] ); ?>
|
@@ -74,15 +89,15 @@
|
|
74 |
</a>
|
75 |
<span class="<?php echo 'Y' !== $arr_settings['ssba_bar_show_share_count'] ? esc_attr( 'ssba-hide-button' ) : ''; ?> ssbp-each-share">1.8k</span>
|
76 |
</li>
|
77 |
-
|
78 |
<?php endif; ?>
|
79 |
</ul>
|
80 |
</div>
|
81 |
</div>
|
82 |
<?php
|
83 |
-
echo $this->forms->ssbp_checkboxes( $opts45 ); //
|
84 |
-
echo $this->forms->ssbp_checkboxes( $share_bar_display ); //
|
85 |
-
echo $this->forms->ssbp_input( $page_omit_bar ); //
|
86 |
?>
|
87 |
<div class="accor-wrap">
|
88 |
<div class="accor-tab">
|
@@ -96,14 +111,14 @@
|
|
96 |
</div>
|
97 |
|
98 |
<div class="col-md-6">
|
99 |
-
<?php echo $this->forms->ssbp_input( $opts46 ); //
|
100 |
</div>
|
101 |
<div class="col-md-6">
|
102 |
-
<?php echo $this->forms->ssbp_input( $opts47 ); //
|
103 |
</div>
|
104 |
|
105 |
<div class="col-md-12">
|
106 |
-
<?php echo $this->forms->ssbp_input( $mobile_breakpoint ); //
|
107 |
</div>
|
108 |
|
109 |
<div class="col-md-12">
|
@@ -111,12 +126,12 @@
|
|
111 |
</div>
|
112 |
|
113 |
<div class="col-md-6">
|
114 |
-
<?php echo $this->forms->ssbp_input( $share_height ); //
|
115 |
-
<?php echo $this->forms->ssbp_input( $share_width ); //
|
116 |
</div>
|
117 |
<div class="col-md-6">
|
118 |
-
<?php echo $this->forms->ssbp_input( $share_icon_size ); //
|
119 |
-
<?php echo $this->forms->ssbp_input( $share_margin ); //
|
120 |
</div>
|
121 |
|
122 |
<div class="col-md-12">
|
@@ -124,12 +139,12 @@
|
|
124 |
</div>
|
125 |
|
126 |
<div class="col-md-6">
|
127 |
-
<?php echo $this->forms->ssbp_input( $share_button_color ); //
|
128 |
-
<?php echo $this->forms->ssbp_input( $share_hover_color ); //
|
129 |
</div>
|
130 |
<div class="col-md-6">
|
131 |
-
<?php echo $this->forms->ssbp_input( $share_icon_color ); //
|
132 |
-
<?php echo $this->forms->ssbp_input( $share_icon_hover_color ); //
|
133 |
</div>
|
134 |
</div>
|
135 |
</div>
|
@@ -147,8 +162,8 @@
|
|
147 |
|
148 |
<div class="col-md-12 share-count-prev">
|
149 |
<?php
|
150 |
-
echo $this->forms->ssbp_input( $opts19s ); //
|
151 |
-
echo $this->forms->ssbp_input( $opts20s ); //
|
152 |
?>
|
153 |
</div>
|
154 |
</div>
|
@@ -167,13 +182,13 @@
|
|
167 |
|
168 |
<div class="col-md-12">
|
169 |
<?php
|
170 |
-
echo $this->forms->ssbp_input( $opts28s ); //
|
171 |
-
echo $this->forms->ssbp_input( $opts29s ); //
|
172 |
?>
|
173 |
</div>
|
174 |
|
175 |
<div class="col-md-12">
|
176 |
-
<?php echo $this->forms->ssbp_input( $opts31s ); //
|
177 |
</div>
|
178 |
|
179 |
<div class="col-md-12">
|
@@ -181,7 +196,7 @@
|
|
181 |
</div>
|
182 |
|
183 |
<div class="col-md-12">
|
184 |
-
<?php echo $this->forms->ssbp_input( $opts33s ); //
|
185 |
</div>
|
186 |
|
187 |
<div class="col-md-12">
|
@@ -189,26 +204,26 @@
|
|
189 |
</div>
|
190 |
|
191 |
<div class="col-md-12">
|
192 |
-
<?php echo $this->forms->ssbp_input( $opts32s ); //
|
193 |
</div>
|
194 |
|
195 |
<div class="col-md-6">
|
196 |
<?php
|
197 |
-
echo $this->forms->ssbp_input( $opts34s ); //
|
198 |
-
echo $this->forms->ssbp_input( $opts37s ); //
|
199 |
?>
|
200 |
</div>
|
201 |
<div class="col-md-6">
|
202 |
<?php
|
203 |
-
echo $this->forms->ssbp_input( $opts35s ); //
|
204 |
-
echo $this->forms->ssbp_input( $opts36s ); //
|
205 |
?>
|
206 |
</div>
|
207 |
|
208 |
<div class="col-md-12">
|
209 |
<?php
|
210 |
-
echo $this->forms->ssbp_input( $opts38s ); //
|
211 |
-
echo $this->forms->ssbp_input( $opts39s ); //
|
212 |
?>
|
213 |
</div>
|
214 |
</div>
|
@@ -232,7 +247,7 @@
|
|
232 |
</div>
|
233 |
|
234 |
<div class="col-sm-12">
|
235 |
-
<?php echo $this->forms->ssbp_input( $opts40s ); //
|
236 |
</div>
|
237 |
</div>
|
238 |
</div>
|
4 |
*
|
5 |
* The template wrapper for the share bar tab.
|
6 |
*
|
7 |
+
* @var \SimpleShareButtonsAdder\Admin_Panel $this Admin panel class.
|
8 |
+
*
|
9 |
* @package SimpleShareButtonsAdder
|
10 |
*/
|
11 |
|
12 |
?>
|
13 |
+
<div class="tab-pane fade <?php echo 'active' === $bar ? esc_attr( $bar . ' in' ) : ''; ?>" id="share-bar">
|
14 |
<div class="col-sm-12 ssba-tab-container">
|
15 |
+
<?php echo $this->forms->ssbp_input( $share_bar ); // phpcs:ignore ?>
|
16 |
|
17 |
<blockquote>
|
18 |
<p>
|
26 |
<div class="ssbp-wrap ssbp--centred ssbp--theme-4">
|
27 |
<div class="ssbp-container">
|
28 |
<ul id="ssbasort3" class="ssbp-list ssbaSortable">
|
29 |
+
<?php
|
30 |
+
$arr_settings = array_merge(
|
31 |
+
$arr_settings,
|
32 |
+
array(
|
33 |
+
'bar_call' => 'Y',
|
34 |
)
|
35 |
);
|
36 |
|
37 |
+
echo wp_kses_post(
|
38 |
+
$this->get_available_ssba(
|
39 |
+
$arr_settings['ssba_selected_bar_buttons'],
|
40 |
+
$arr_settings
|
41 |
+
)
|
42 |
+
);
|
43 |
+
?>
|
44 |
</ul>
|
45 |
</div>
|
46 |
</div>
|
71 |
<div class="ssbp-container">
|
72 |
<ul class="ssbp-list">
|
73 |
<?php if ( is_array( $arr_bar_buttons ) ) : ?>
|
74 |
+
<?php
|
75 |
+
foreach ( $arr_bar_buttons as $buttons ) :
|
76 |
+
$button = strtolower( str_replace( ' ', '_', str_replace( '+', '', $buttons['full_name'] ) ) );
|
77 |
+
?>
|
78 |
+
<li style="margin: <?php echo esc_attr( $arr_settings['ssba_bar_margin'] ); ?>px 0;" class="ssbp-li--<?php echo esc_attr( $button ); ?>
|
79 |
+
<?php
|
80 |
+
if ( false === in_array( $button, explode( ',', $arr_settings['ssba_selected_bar_buttons'] ), true ) ) {
|
81 |
+
echo esc_attr( ' ssba-hide-button' );
|
82 |
+
}
|
83 |
+
?>
|
84 |
+
">
|
85 |
<a href="#" class="ssbp-btn ssbp-<?php echo esc_attr( $button ); ?>" style="height: <?php echo esc_attr( $arr_settings['ssba_bar_height'] ); ?>px; width: <?php echo esc_attr( $arr_settings['ssba_bar_width'] ); ?>px; <?php echo '' !== $arr_settings['ssba_bar_button_color'] ? esc_attr( 'background: ' . $arr_settings['ssba_bar_button_color'] . ';' ) : ''; ?>">
|
86 |
<div title="<?php echo esc_attr( $buttons['full_name'] ); ?>" class="ssbp-text">
|
87 |
<?php echo esc_html( $buttons['full_name'] ); ?>
|
89 |
</a>
|
90 |
<span class="<?php echo 'Y' !== $arr_settings['ssba_bar_show_share_count'] ? esc_attr( 'ssba-hide-button' ) : ''; ?> ssbp-each-share">1.8k</span>
|
91 |
</li>
|
92 |
+
<?php endforeach; ?>
|
93 |
<?php endif; ?>
|
94 |
</ul>
|
95 |
</div>
|
96 |
</div>
|
97 |
<?php
|
98 |
+
echo $this->forms->ssbp_checkboxes( $opts45 ); // phpcs:ignore
|
99 |
+
echo $this->forms->ssbp_checkboxes( $share_bar_display ); // phpcs:ignore
|
100 |
+
echo $this->forms->ssbp_input( $page_omit_bar ); // phpcs:ignore
|
101 |
?>
|
102 |
<div class="accor-wrap">
|
103 |
<div class="accor-tab">
|
111 |
</div>
|
112 |
|
113 |
<div class="col-md-6">
|
114 |
+
<?php echo $this->forms->ssbp_input( $opts46 ); // phpcs:ignore ?>
|
115 |
</div>
|
116 |
<div class="col-md-6">
|
117 |
+
<?php echo $this->forms->ssbp_input( $opts47 ); // phpcs:ignore ?>
|
118 |
</div>
|
119 |
|
120 |
<div class="col-md-12">
|
121 |
+
<?php echo $this->forms->ssbp_input( $mobile_breakpoint ); // phpcs:ignore ?>
|
122 |
</div>
|
123 |
|
124 |
<div class="col-md-12">
|
126 |
</div>
|
127 |
|
128 |
<div class="col-md-6">
|
129 |
+
<?php echo $this->forms->ssbp_input( $share_height ); // phpcs:ignore ?>
|
130 |
+
<?php echo $this->forms->ssbp_input( $share_width ); // phpcs:ignore ?>
|
131 |
</div>
|
132 |
<div class="col-md-6">
|
133 |
+
<?php echo $this->forms->ssbp_input( $share_icon_size ); // phpcs:ignore ?>
|
134 |
+
<?php echo $this->forms->ssbp_input( $share_margin ); // phpcs:ignore ?>
|
135 |
</div>
|
136 |
|
137 |
<div class="col-md-12">
|
139 |
</div>
|
140 |
|
141 |
<div class="col-md-6">
|
142 |
+
<?php echo $this->forms->ssbp_input( $share_button_color ); // phpcs:ignore ?>
|
143 |
+
<?php echo $this->forms->ssbp_input( $share_hover_color ); // phpcs:ignore ?>
|
144 |
</div>
|
145 |
<div class="col-md-6">
|
146 |
+
<?php echo $this->forms->ssbp_input( $share_icon_color ); // phpcs:ignore ?>
|
147 |
+
<?php echo $this->forms->ssbp_input( $share_icon_hover_color ); // phpcs:ignore ?>
|
148 |
</div>
|
149 |
</div>
|
150 |
</div>
|
162 |
|
163 |
<div class="col-md-12 share-count-prev">
|
164 |
<?php
|
165 |
+
echo $this->forms->ssbp_input( $opts19s ); // phpcs:ignore
|
166 |
+
echo $this->forms->ssbp_input( $opts20s ); // phpcs:ignore
|
167 |
?>
|
168 |
</div>
|
169 |
</div>
|
182 |
|
183 |
<div class="col-md-12">
|
184 |
<?php
|
185 |
+
echo $this->forms->ssbp_input( $opts28s ); // phpcs:ignore
|
186 |
+
echo $this->forms->ssbp_input( $opts29s ); // phpcs:ignore
|
187 |
?>
|
188 |
</div>
|
189 |
|
190 |
<div class="col-md-12">
|
191 |
+
<?php echo $this->forms->ssbp_input( $opts31s ); // phpcs:ignore ?>
|
192 |
</div>
|
193 |
|
194 |
<div class="col-md-12">
|
196 |
</div>
|
197 |
|
198 |
<div class="col-md-12">
|
199 |
+
<?php echo $this->forms->ssbp_input( $opts33s ); // phpcs:ignore ?>
|
200 |
</div>
|
201 |
|
202 |
<div class="col-md-12">
|
204 |
</div>
|
205 |
|
206 |
<div class="col-md-12">
|
207 |
+
<?php echo $this->forms->ssbp_input( $opts32s ); // phpcs:ignore ?>
|
208 |
</div>
|
209 |
|
210 |
<div class="col-md-6">
|
211 |
<?php
|
212 |
+
echo $this->forms->ssbp_input( $opts34s ); // phpcs:ignore
|
213 |
+
echo $this->forms->ssbp_input( $opts37s ); // phpcs:ignore
|
214 |
?>
|
215 |
</div>
|
216 |
<div class="col-md-6">
|
217 |
<?php
|
218 |
+
echo $this->forms->ssbp_input( $opts35s ); // phpcs:ignore
|
219 |
+
echo $this->forms->ssbp_input( $opts36s ); // phpcs:ignore
|
220 |
?>
|
221 |
</div>
|
222 |
|
223 |
<div class="col-md-12">
|
224 |
<?php
|
225 |
+
echo $this->forms->ssbp_input( $opts38s ); // phpcs:ignore
|
226 |
+
echo $this->forms->ssbp_input( $opts39s ); // phpcs:ignore
|
227 |
?>
|
228 |
</div>
|
229 |
</div>
|
247 |
</div>
|
248 |
|
249 |
<div class="col-sm-12">
|
250 |
+
<?php echo $this->forms->ssbp_input( $opts40s ); // phpcs:ignore ?>
|
251 |
</div>
|
252 |
</div>
|
253 |
</div>
|