Completed
Push — master ( 8d1412...e15369 )
by
unknown
49s
created
social_profiles/inc/class-redux-social-profiles-defaults.php 1 patch
Indentation   +917 added lines, -917 removed lines patch added patch discarded remove patch
@@ -11,922 +11,922 @@
 block discarded – undo
11 11
 
12 12
 if ( ! class_exists( 'Redux_Social_Profiles_Defaults' ) ) {
13 13
 
14
-	/**
15
-	 * Class Redux_Social_Profiles_Defaults
16
-	 */
17
-	class Redux_Social_Profiles_Defaults {
14
+    /**
15
+     * Class Redux_Social_Profiles_Defaults
16
+     */
17
+    class Redux_Social_Profiles_Defaults {
18 18
 
19
-		/**
20
-		 * Get defaults array.
21
-		 *
22
-		 * @return array
23
-		 */
24
-		public static function get_social_media_defaults(): array {
25
-			return array(
26
-				0  => array(
27
-					'id'         => 'adn',
28
-					'icon'       => 'fa-adn',
29
-					'class'      => 'fa',
30
-					'enabled'    => false,
31
-					'name'       => esc_html__( 'ADN', 'redux-framework' ),
32
-					'background' => '',
33
-					'color'      => '#000000',
34
-					'url'        => '',
35
-					'order'      => 0,
36
-				),
37
-				1  => array(
38
-					'id'         => 'android',
39
-					'icon'       => 'fa-android',
40
-					'class'      => 'fa',
41
-					'enabled'    => false,
42
-					'name'       => esc_html__( 'Android', 'redux-framework' ),
43
-					'background' => '',
44
-					'color'      => '#A4C639',
45
-					'url'        => '',
46
-					'order'      => 1,
47
-				),
48
-				2  => array(
49
-					'id'         => 'apple',
50
-					'icon'       => 'fa-apple',
51
-					'class'      => 'fa',
52
-					'enabled'    => false,
53
-					'name'       => esc_html__( 'Apple', 'redux-framework' ),
54
-					'style'      => '',
55
-					'background' => '',
56
-					'color'      => '#e4e4e5',
57
-					'url'        => '',
58
-					'order'      => 2,
59
-				),
60
-				3  => array(
61
-					'id'         => 'behance',
62
-					'icon'       => 'fa-behance',
63
-					'class'      => 'fa',
64
-					'enabled'    => false,
65
-					'name'       => esc_html__( 'behance', 'redux-framework' ),
66
-					'background' => '',
67
-					'color'      => '#1769ff',
68
-					'url'        => '',
69
-					'order'      => 3,
70
-				),
71
-				4  => array(
72
-					'id'         => 'behance-square',
73
-					'icon'       => 'fa-behance-square',
74
-					'class'      => 'fa',
75
-					'enabled'    => false,
76
-					'name'       => esc_html__( 'behance square', 'redux-framework' ),
77
-					'background' => '',
78
-					'color'      => '#1769ff',
79
-					'url'        => '',
80
-					'order'      => 4,
81
-				),
82
-				5  => array(
83
-					'id'         => 'bitbucket',
84
-					'icon'       => 'fa-bitbucket',
85
-					'class'      => 'fa',
86
-					'enabled'    => false,
87
-					'name'       => esc_html__( 'Bitbucket', 'redux-framework' ),
88
-					'background' => '',
89
-					'color'      => '#205081',
90
-					'url'        => '',
91
-					'order'      => 5,
92
-				),
93
-				6  => array(
94
-					'id'         => 'bitbucket-square',
95
-					'icon'       => 'fa-bitbucket-square',
96
-					'class'      => 'fa',
97
-					'enabled'    => false,
98
-					'name'       => esc_html__( 'Bitbucket square', 'redux-framework' ),
99
-					'background' => '',
100
-					'color'      => '#205081',
101
-					'url'        => '',
102
-					'order'      => 6,
103
-				),
104
-				7  => array(
105
-					'id'         => 'bitcoin',
106
-					'icon'       => 'fa-btc',
107
-					'class'      => 'fa',
108
-					'enabled'    => false,
109
-					'name'       => esc_html__( 'Bitcoin', 'redux-framework' ),
110
-					'background' => '',
111
-					'color'      => '#000000',
112
-					'url'        => '',
113
-					'order'      => 7,
114
-				),
115
-				8  => array(
116
-					'id'         => 'codepen',
117
-					'icon'       => 'fa-codepen',
118
-					'class'      => 'fa',
119
-					'enabled'    => false,
120
-					'name'       => esc_html__( 'CodePen', 'redux-framework' ),
121
-					'background' => '',
122
-					'color'      => '#000000',
123
-					'url'        => '',
124
-					'order'      => 8,
125
-				),
126
-				9  => array(
127
-					'id'         => 'css3',
128
-					'icon'       => 'fa-css3',
129
-					'class'      => 'fa',
130
-					'enabled'    => false,
131
-					'name'       => esc_html__( 'CSS3', 'redux-framework' ),
132
-					'background' => '',
133
-					'color'      => '#000000',
134
-					'url'        => '',
135
-					'order'      => 9,
136
-				),
137
-				10 => array(
138
-					'id'         => 'delicious',
139
-					'icon'       => 'fa-delicious',
140
-					'class'      => 'fa',
141
-					'enabled'    => false,
142
-					'name'       => esc_html__( 'Delicious', 'redux-framework' ),
143
-					'background' => '',
144
-					'color'      => '#3399ff',
145
-					'url'        => '',
146
-					'order'      => 10,
147
-				),
148
-				11 => array(
149
-					'id'         => 'deviantart',
150
-					'icon'       => 'fa-deviantart',
151
-					'class'      => 'fa',
152
-					'enabled'    => false,
153
-					'name'       => esc_html__( 'Deviantart', 'redux-framework' ),
154
-					'background' => '',
155
-					'color'      => '#4e6252',
156
-					'url'        => '',
157
-					'order'      => 11,
158
-				),
159
-				12 => array(
160
-					'id'         => 'digg',
161
-					'icon'       => 'fa-digg',
162
-					'class'      => 'fa',
163
-					'enabled'    => false,
164
-					'name'       => esc_html__( 'Digg', 'redux-framework' ),
165
-					'background' => '',
166
-					'color'      => '#000000',
167
-					'url'        => '',
168
-					'order'      => 12,
169
-				),
170
-				13 => array(
171
-					'id'         => 'dribbble',
172
-					'icon'       => 'fa-dribbble',
173
-					'class'      => 'fa',
174
-					'enabled'    => false,
175
-					'name'       => esc_html__( 'Dribbble', 'redux-framework' ),
176
-					'background' => '',
177
-					'color'      => '#444444',
178
-					'url'        => '',
179
-					'order'      => 13,
180
-				),
181
-				14 => array(
182
-					'id'         => 'dropbox',
183
-					'icon'       => 'fa-dropbox',
184
-					'class'      => 'fa',
185
-					'enabled'    => false,
186
-					'name'       => esc_html__( 'Dropbox', 'redux-framework' ),
187
-					'background' => '',
188
-					'color'      => '#007ee5',
189
-					'url'        => '',
190
-					'order'      => 14,
191
-				),
192
-				15 => array(
193
-					'id'         => 'drupal',
194
-					'icon'       => 'fa-drupal',
195
-					'class'      => 'fa',
196
-					'enabled'    => false,
197
-					'name'       => esc_html__( 'Drupal', 'redux-framework' ),
198
-					'background' => '',
199
-					'color'      => '#0077c0',
200
-					'url'        => '',
201
-					'order'      => 15,
202
-				),
203
-				16 => array(
204
-					'id'         => 'empire',
205
-					'icon'       => 'fa-empire',
206
-					'class'      => 'fa',
207
-					'enabled'    => false,
208
-					'name'       => esc_html__( 'Empire', 'redux-framework' ),
209
-					'background' => '',
210
-					'color'      => '#000000',
211
-					'url'        => '',
212
-					'order'      => 16,
213
-				),
214
-				17 => array(
215
-					'id'         => 'facebook',
216
-					'icon'       => 'fa-facebook',
217
-					'class'      => 'fa',
218
-					'enabled'    => false,
219
-					'name'       => esc_html__( 'Facebook', 'redux-framework' ),
220
-					'background' => '',
221
-					'color'      => '#3b5998',
222
-					'url'        => '',
223
-					'order'      => 17,
224
-				),
225
-				18 => array(
226
-					'id'         => 'facebook-square',
227
-					'icon'       => 'fa-facebook-square',
228
-					'class'      => 'fa',
229
-					'enabled'    => false,
230
-					'name'       => esc_html__( 'Facebook square', 'redux-framework' ),
231
-					'background' => '',
232
-					'color'      => '#3b5998',
233
-					'url'        => '',
234
-					'order'      => 18,
235
-				),
236
-				19 => array(
237
-					'id'         => 'flickr',
238
-					'icon'       => 'fa-flickr',
239
-					'class'      => 'fa',
240
-					'enabled'    => false,
241
-					'name'       => esc_html__( 'Flickr', 'redux-framework' ),
242
-					'background' => '',
243
-					'color'      => '#0063dc',
244
-					'url'        => '',
245
-					'order'      => 19,
246
-				),
247
-				20 => array(
248
-					'id'         => 'foursquare',
249
-					'icon'       => 'fa-foursquare',
250
-					'class'      => 'fa',
251
-					'enabled'    => false,
252
-					'name'       => esc_html__( 'FourSquare', 'redux-framework' ),
253
-					'background' => '',
254
-					'color'      => '#0072b1',
255
-					'url'        => '',
256
-					'order'      => 20,
257
-				),
258
-				21 => array(
259
-					'id'         => 'git',
260
-					'icon'       => 'fa-git',
261
-					'class'      => 'fa',
262
-					'enabled'    => false,
263
-					'name'       => esc_html__( 'git', 'redux-framework' ),
264
-					'background' => '',
265
-					'color'      => '#000000',
266
-					'url'        => '',
267
-					'order'      => 21,
268
-				),
269
-				22 => array(
270
-					'id'         => 'git-square',
271
-					'icon'       => 'fa-git-square',
272
-					'class'      => 'fa',
273
-					'enabled'    => false,
274
-					'name'       => esc_html__( 'git square', 'redux-framework' ),
275
-					'background' => '',
276
-					'color'      => '#000000',
277
-					'url'        => '',
278
-					'order'      => 22,
279
-				),
280
-				23 => array(
281
-					'id'         => 'github',
282
-					'icon'       => 'fa-github',
283
-					'class'      => 'fa',
284
-					'enabled'    => false,
285
-					'name'       => esc_html__( 'github', 'redux-framework' ),
286
-					'background' => '',
287
-					'color'      => '#4183c4',
288
-					'url'        => '',
289
-					'order'      => 23,
290
-				),
291
-				24 => array(
292
-					'id'         => 'github-alt',
293
-					'icon'       => 'fa-github-alt',
294
-					'class'      => 'fa',
295
-					'enabled'    => false,
296
-					'name'       => esc_html__( 'github alt', 'redux-framework' ),
297
-					'background' => '',
298
-					'color'      => '#4183c4',
299
-					'url'        => '',
300
-					'order'      => 24,
301
-				),
302
-				25 => array(
303
-					'id'         => 'github-square',
304
-					'icon'       => 'fa-github-square',
305
-					'class'      => 'fa',
306
-					'enabled'    => false,
307
-					'name'       => esc_html__( 'github square', 'redux-framework' ),
308
-					'background' => '',
309
-					'color'      => '#4183c4',
310
-					'url'        => '',
311
-					'order'      => 25,
312
-				),
313
-				26 => array(
314
-					'id'         => 'gittip',
315
-					'icon'       => 'fa-gittip',
316
-					'class'      => 'fa',
317
-					'enabled'    => false,
318
-					'name'       => esc_html__( 'git tip', 'redux-framework' ),
319
-					'background' => '',
320
-					'color'      => '#000000',
321
-					'url'        => '',
322
-					'order'      => 26,
323
-				),
324
-				27 => array(
325
-					'id'         => 'google',
326
-					'icon'       => 'fa-google',
327
-					'class'      => 'fa',
328
-					'enabled'    => false,
329
-					'name'       => esc_html__( 'Google', 'redux-framework' ),
330
-					'background' => '',
331
-					'color'      => '#dd4b39',
332
-					'url'        => '',
333
-					'order'      => 27,
334
-				),
335
-				28 => array(
336
-					'id'         => 'google-plus',
337
-					'icon'       => 'fa-google-plus',
338
-					'class'      => 'fa',
339
-					'enabled'    => false,
340
-					'name'       => esc_html__( 'Google Plus', 'redux-framework' ),
341
-					'background' => '',
342
-					'color'      => '#dd4b39',
343
-					'url'        => '',
344
-					'order'      => 28,
345
-				),
346
-				29 => array(
347
-					'id'         => 'google-plus-square',
348
-					'icon'       => 'fa-google-plus-square',
349
-					'class'      => 'fa',
350
-					'enabled'    => false,
351
-					'name'       => esc_html__( 'Google Plus square', 'redux-framework' ),
352
-					'background' => '',
353
-					'color'      => '#dd4b39',
354
-					'url'        => '',
355
-					'order'      => 29,
356
-				),
357
-				30 => array(
358
-					'id'         => 'hacker-news',
359
-					'icon'       => 'fa-hacker-news',
360
-					'class'      => 'fa',
361
-					'enabled'    => false,
362
-					'name'       => esc_html__( 'Hacker News', 'redux-framework' ),
363
-					'background' => '',
364
-					'color'      => '#ff6600',
365
-					'url'        => '',
366
-					'order'      => 30,
367
-				),
368
-				31 => array(
369
-					'id'         => 'html5',
370
-					'icon'       => 'fa-html5',
371
-					'class'      => 'fa',
372
-					'enabled'    => false,
373
-					'name'       => esc_html__( 'HTML5', 'redux-framework' ),
374
-					'background' => '',
375
-					'color'      => '#e34f26',
376
-					'url'        => '',
377
-					'order'      => 31,
378
-				),
379
-				32 => array(
380
-					'id'         => 'instagram',
381
-					'icon'       => 'fa-instagram',
382
-					'class'      => 'fa',
383
-					'enabled'    => false,
384
-					'name'       => esc_html__( 'Instagram', 'redux-framework' ),
385
-					'background' => '',
386
-					'color'      => '#3f729b',
387
-					'url'        => '',
388
-					'order'      => 32,
389
-				),
390
-				33 => array(
391
-					'id'         => 'joomla',
392
-					'icon'       => 'fa-joomla',
393
-					'class'      => 'fa',
394
-					'enabled'    => false,
395
-					'name'       => esc_html__( 'Joomla', 'redux-framework' ),
396
-					'background' => '',
397
-					'color'      => '#000000',
398
-					'url'        => '',
399
-					'order'      => 33,
400
-				),
401
-				34 => array(
402
-					'id'         => 'jsfiddle',
403
-					'icon'       => 'fa-jsfiddle',
404
-					'class'      => 'fa',
405
-					'enabled'    => false,
406
-					'name'       => esc_html__( 'JS Fiddle', 'redux-framework' ),
407
-					'background' => '',
408
-					'color'      => '#000000',
409
-					'url'        => '',
410
-					'order'      => 34,
411
-				),
412
-				35 => array(
413
-					'id'         => 'linkedin',
414
-					'icon'       => 'fa-linkedin',
415
-					'class'      => 'fa',
416
-					'enabled'    => false,
417
-					'name'       => esc_html__( 'LinkedIn', 'redux-framework' ),
418
-					'background' => '',
419
-					'color'      => '#0976b4',
420
-					'url'        => '',
421
-					'order'      => 35,
422
-				),
423
-				36 => array(
424
-					'id'         => 'linkedin-square',
425
-					'icon'       => 'fa-linkedin-square',
426
-					'class'      => 'fa',
427
-					'enabled'    => false,
428
-					'name'       => esc_html__( 'LinkedIn square', 'redux-framework' ),
429
-					'background' => '',
430
-					'color'      => '#0976b4',
431
-					'url'        => '',
432
-					'order'      => 36,
433
-				),
434
-				37 => array(
435
-					'id'         => 'linux',
436
-					'icon'       => 'fa-linux',
437
-					'class'      => 'fa',
438
-					'enabled'    => false,
439
-					'name'       => esc_html__( 'Linux', 'redux-framework' ),
440
-					'background' => '',
441
-					'color'      => '#333333',
442
-					'url'        => '',
443
-					'order'      => 37,
444
-				),
445
-				38 => array(
446
-					'id'         => 'maxcdn',
447
-					'icon'       => 'fa-maxcdn',
448
-					'class'      => 'fa',
449
-					'enabled'    => false,
450
-					'name'       => esc_html__( 'MaxCDN', 'redux-framework' ),
451
-					'background' => '',
452
-					'color'      => '#f8711e',
453
-					'url'        => '',
454
-					'order'      => 38,
455
-				),
456
-				39 => array(
457
-					'id'         => 'openid',
458
-					'icon'       => 'fa-openid',
459
-					'class'      => 'fa',
460
-					'enabled'    => false,
461
-					'name'       => esc_html__( 'OpenID', 'redux-framework' ),
462
-					'background' => '',
463
-					'color'      => '#000000',
464
-					'url'        => '',
465
-					'order'      => 39,
466
-				),
467
-				40 => array(
468
-					'id'         => 'pagelines',
469
-					'icon'       => 'fa-pagelines',
470
-					'class'      => 'fa',
471
-					'enabled'    => false,
472
-					'name'       => esc_html__( 'Page Lines', 'redux-framework' ),
473
-					'background' => '',
474
-					'color'      => '#000000',
475
-					'url'        => '',
476
-					'order'      => 40,
477
-				),
478
-				41 => array(
479
-					'id'         => 'pied-piper',
480
-					'icon'       => 'fa-pied-piper',
481
-					'class'      => 'fa',
482
-					'enabled'    => false,
483
-					'name'       => esc_html__( 'Pied Piper', 'redux-framework' ),
484
-					'background' => '',
485
-					'color'      => '#000000',
486
-					'url'        => '',
487
-					'order'      => 41,
488
-				),
489
-				42 => array(
490
-					'id'         => 'pied-piper-alt',
491
-					'icon'       => 'fa-pied-piper-alt',
492
-					'class'      => 'fa',
493
-					'enabled'    => false,
494
-					'name'       => esc_html__( 'Pied Piper alt', 'redux-framework' ),
495
-					'background' => '',
496
-					'color'      => '#000000',
497
-					'url'        => '',
498
-					'order'      => 42,
499
-				),
500
-				43 => array(
501
-					'id'         => 'pinterest',
502
-					'icon'       => 'fa-pinterest',
503
-					'class'      => 'fa',
504
-					'enabled'    => false,
505
-					'name'       => esc_html__( 'Pinterest', 'redux-framework' ),
506
-					'background' => '',
507
-					'color'      => '#1769ff',
508
-					'url'        => '',
509
-					'order'      => 43,
510
-				),
511
-				44 => array(
512
-					'id'         => 'pinterest-square',
513
-					'icon'       => 'fa-pinterest-square',
514
-					'class'      => 'fa',
515
-					'enabled'    => false,
516
-					'name'       => esc_html__( 'Pinterest square', 'redux-framework' ),
517
-					'background' => '',
518
-					'color'      => '#1769ff',
519
-					'url'        => '',
520
-					'order'      => 44,
521
-				),
522
-				45 => array(
523
-					'id'         => 'qq',
524
-					'icon'       => 'fa-qq',
525
-					'class'      => 'fa',
526
-					'enabled'    => false,
527
-					'name'       => esc_html__( 'QQ', 'redux-framework' ),
528
-					'background' => '',
529
-					'color'      => '#000000',
530
-					'url'        => '',
531
-					'order'      => 45,
532
-				),
533
-				46 => array(
534
-					'id'         => 'rebel',
535
-					'icon'       => 'fa-rebel',
536
-					'class'      => 'fa',
537
-					'enabled'    => false,
538
-					'name'       => esc_html__( 'Rebel', 'redux-framework' ),
539
-					'background' => '',
540
-					'color'      => '#517fa4',
541
-					'url'        => '',
542
-					'order'      => 46,
543
-				),
544
-				47 => array(
545
-					'id'         => 'reddit',
546
-					'icon'       => 'fa-reddit',
547
-					'class'      => 'fa',
548
-					'enabled'    => false,
549
-					'name'       => esc_html__( 'Reddit', 'redux-framework' ),
550
-					'background' => '',
551
-					'color'      => '#ff4500',
552
-					'url'        => '',
553
-					'order'      => 47,
554
-				),
555
-				48 => array(
556
-					'id'         => 'reddit-square',
557
-					'icon'       => 'fa-reddit-square',
558
-					'class'      => 'fa',
559
-					'enabled'    => false,
560
-					'name'       => esc_html__( 'Reddit square', 'redux-framework' ),
561
-					'background' => '',
562
-					'color'      => '#ff4500',
563
-					'url'        => '',
564
-					'order'      => 48,
565
-				),
566
-				49 => array(
567
-					'id'         => 'renren',
568
-					'icon'       => 'fa-renren',
569
-					'class'      => 'fa',
570
-					'enabled'    => false,
571
-					'name'       => esc_html__( 'Ren Ren', 'redux-framework' ),
572
-					'background' => '',
573
-					'color'      => '#007bb6',
574
-					'url'        => '',
575
-					'order'      => 49,
576
-				),
577
-				50 => array(
578
-					'id'         => 'share-alt',
579
-					'icon'       => 'fa-share-alt',
580
-					'class'      => 'fa',
581
-					'enabled'    => false,
582
-					'name'       => esc_html__( 'Share alt', 'redux-framework' ),
583
-					'background' => '',
584
-					'color'      => '#000000',
585
-					'url'        => '',
586
-					'order'      => 50,
587
-				),
588
-				51 => array(
589
-					'id'         => 'share-alt-square',
590
-					'icon'       => 'fa-share-alt-square',
591
-					'class'      => 'fa',
592
-					'enabled'    => false,
593
-					'name'       => esc_html__( 'Share square', 'redux-framework' ),
594
-					'background' => '',
595
-					'color'      => '#000000',
596
-					'url'        => '',
597
-					'order'      => 51,
598
-				),
599
-				52 => array(
600
-					'id'         => 'skype',
601
-					'icon'       => 'fa-skype',
602
-					'class'      => 'fa',
603
-					'enabled'    => false,
604
-					'name'       => esc_html__( 'Skype', 'redux-framework' ),
605
-					'background' => '',
606
-					'color'      => '#00aff0',
607
-					'url'        => '',
608
-					'order'      => 52,
609
-				),
610
-				53 => array(
611
-					'id'         => 'slack',
612
-					'icon'       => 'fa-slack',
613
-					'class'      => 'fa',
614
-					'enabled'    => false,
615
-					'name'       => esc_html__( 'Slack', 'redux-framework' ),
616
-					'background' => '',
617
-					'color'      => '#000000',
618
-					'url'        => '',
619
-					'order'      => 53,
620
-				),
621
-				54 => array(
622
-					'id'         => 'soundcloud',
623
-					'icon'       => 'fa-soundcloud',
624
-					'class'      => 'fa',
625
-					'enabled'    => false,
626
-					'name'       => esc_html__( 'Sound Cloud', 'redux-framework' ),
627
-					'background' => '',
628
-					'color'      => '#f80',
629
-					'url'        => '',
630
-					'order'      => 54,
631
-				),
632
-				55 => array(
633
-					'id'         => 'spotify',
634
-					'icon'       => 'fa-spotify',
635
-					'class'      => 'fa',
636
-					'enabled'    => false,
637
-					'name'       => esc_html__( 'Spotify', 'redux-framework' ),
638
-					'background' => '',
639
-					'color'      => '#7ab800',
640
-					'url'        => '',
641
-					'order'      => 55,
642
-				),
643
-				56 => array(
644
-					'id'         => 'stack-exchange',
645
-					'icon'       => 'fa-stack-exchange',
646
-					'class'      => 'fa',
647
-					'enabled'    => false,
648
-					'name'       => esc_html__( 'Stack Exchange', 'redux-framework' ),
649
-					'background' => '',
650
-					'color'      => '#000000',
651
-					'url'        => '',
652
-					'order'      => 56,
653
-				),
654
-				57 => array(
655
-					'id'         => 'stack-overflow',
656
-					'icon'       => 'fa-stack-overflow',
657
-					'class'      => 'fa',
658
-					'enabled'    => false,
659
-					'name'       => esc_html__( 'Stack Overflow', 'redux-framework' ),
660
-					'background' => '',
661
-					'color'      => '#fe7a15',
662
-					'url'        => '',
663
-					'order'      => 57,
664
-				),
665
-				58 => array(
666
-					'id'         => 'steam',
667
-					'icon'       => 'fa-steam',
668
-					'class'      => 'fa',
669
-					'enabled'    => false,
670
-					'name'       => esc_html__( 'Steam', 'redux-framework' ),
671
-					'background' => '',
672
-					'color'      => '#000000',
673
-					'url'        => '',
674
-					'order'      => 58,
675
-				),
676
-				59 => array(
677
-					'id'         => 'steam-square',
678
-					'icon'       => 'fa-steam-square',
679
-					'class'      => 'fa',
680
-					'enabled'    => false,
681
-					'name'       => esc_html__( 'Steam square', 'redux-framework' ),
682
-					'background' => '',
683
-					'color'      => '#000000',
684
-					'url'        => '',
685
-					'order'      => 59,
686
-				),
687
-				60 => array(
688
-					'id'         => 'stumbleupon',
689
-					'icon'       => 'fa-stumbleupon',
690
-					'class'      => 'fa',
691
-					'enabled'    => false,
692
-					'name'       => esc_html__( 'Stumble Upon', 'redux-framework' ),
693
-					'background' => '',
694
-					'color'      => '#eb4924',
695
-					'url'        => '',
696
-					'order'      => 60,
697
-				),
698
-				61 => array(
699
-					'id'         => 'stumbleupon-circle',
700
-					'icon'       => 'fa-stumbleupon-circle',
701
-					'class'      => 'fa',
702
-					'enabled'    => false,
703
-					'name'       => esc_html__( 'Stumble Upon circle', 'redux-framework' ),
704
-					'background' => '',
705
-					'color'      => '#eb4924',
706
-					'url'        => '',
707
-					'order'      => 61,
708
-				),
709
-				62 => array(
710
-					'id'         => 'tencent-weibo',
711
-					'icon'       => 'fa-tencent-weibo',
712
-					'class'      => 'fa',
713
-					'enabled'    => false,
714
-					'name'       => esc_html__( 'Tencent Weibo', 'redux-framework' ),
715
-					'background' => '',
716
-					'color'      => '#000000',
717
-					'url'        => '',
718
-					'order'      => 62,
719
-				),
720
-				63 => array(
721
-					'id'         => 'trello',
722
-					'icon'       => 'fa-trello',
723
-					'class'      => 'fa',
724
-					'enabled'    => false,
725
-					'name'       => esc_html__( 'Trello', 'redux-framework' ),
726
-					'background' => '',
727
-					'color'      => '#256a92',
728
-					'url'        => '',
729
-					'order'      => 63,
730
-				),
731
-				64 => array(
732
-					'id'         => 'tumblr',
733
-					'icon'       => 'fa-tumblr',
734
-					'class'      => 'fa',
735
-					'enabled'    => false,
736
-					'name'       => esc_html__( 'Tumblr', 'redux-framework' ),
737
-					'background' => '',
738
-					'color'      => '#35465c',
739
-					'url'        => '',
740
-					'order'      => 64,
741
-				),
742
-				65 => array(
743
-					'id'         => 'tumblr-square',
744
-					'icon'       => 'fa-tumblr-square',
745
-					'class'      => 'fa',
746
-					'enabled'    => false,
747
-					'name'       => esc_html__( 'Tumblr square', 'redux-framework' ),
748
-					'background' => '',
749
-					'color'      => '#35465c',
750
-					'url'        => '',
751
-					'order'      => 65,
752
-				),
753
-				66 => array(
754
-					'id'         => 'twitter',
755
-					'icon'       => 'fa-x-twitter',
756
-					'class'      => 'fa-brands',
757
-					'enabled'    => false,
758
-					'name'       => esc_html__( 'X', 'redux-framework' ),
759
-					'background' => '',
760
-					'color'      => '#55acee',
761
-					'url'        => '',
762
-					'order'      => 66,
763
-				),
764
-				67 => array(
765
-					'id'         => 'twitter-square',
766
-					'icon'       => 'fa-square-x-twitter',
767
-					'class'      => 'fa-brands',
768
-					'enabled'    => false,
769
-					'name'       => esc_html__( 'X square', 'redux-framework' ),
770
-					'background' => '',
771
-					'color'      => '#55acee',
772
-					'url'        => '',
773
-					'order'      => 67,
774
-				),
775
-				68 => array(
776
-					'id'         => 'vimeo-square',
777
-					'icon'       => 'fa-vimeo-square',
778
-					'class'      => 'fa',
779
-					'enabled'    => false,
780
-					'name'       => esc_html__( 'Vimeo square', 'redux-framework' ),
781
-					'background' => '',
782
-					'color'      => '#1ab7ea',
783
-					'url'        => '',
784
-					'order'      => 68,
785
-				),
786
-				69 => array(
787
-					'id'         => 'vine',
788
-					'icon'       => 'fa-vine',
789
-					'class'      => 'fa',
790
-					'enabled'    => false,
791
-					'name'       => esc_html__( 'Vine', 'redux-framework' ),
792
-					'background' => '',
793
-					'color'      => '#00b488',
794
-					'url'        => '',
795
-					'order'      => 69,
796
-				),
797
-				70 => array(
798
-					'id'         => 'vk',
799
-					'icon'       => 'fa-vk',
800
-					'class'      => 'fa',
801
-					'enabled'    => false,
802
-					'name'       => esc_html__( 'VK', 'redux-framework' ),
803
-					'background' => '',
804
-					'color'      => '#000000',
805
-					'url'        => '',
806
-					'order'      => 70,
807
-				),
808
-				71 => array(
809
-					'id'         => 'weibo',
810
-					'icon'       => 'fa-weibo',
811
-					'class'      => 'fa',
812
-					'enabled'    => false,
813
-					'name'       => esc_html__( 'Weibo', 'redux-framework' ),
814
-					'background' => '',
815
-					'color'      => '#000000',
816
-					'url'        => '',
817
-					'order'      => 71,
818
-				),
819
-				72 => array(
820
-					'id'         => 'weixin',
821
-					'icon'       => 'fa-weixin',
822
-					'class'      => 'fa',
823
-					'enabled'    => false,
824
-					'name'       => esc_html__( 'Weixin', 'redux-framework' ),
825
-					'background' => '',
826
-					'color'      => '#000000',
827
-					'url'        => '',
828
-					'order'      => 72,
829
-				),
830
-				73 => array(
831
-					'id'         => 'windows',
832
-					'icon'       => 'fa-windows',
833
-					'class'      => 'fa',
834
-					'enabled'    => false,
835
-					'name'       => esc_html__( 'Windows', 'redux-framework' ),
836
-					'background' => '',
837
-					'color'      => '#00bcf2',
838
-					'url'        => '',
839
-					'order'      => 73,
840
-				),
841
-				74 => array(
842
-					'id'         => 'wordpress',
843
-					'icon'       => 'fa-wordpress',
844
-					'class'      => 'fa',
845
-					'enabled'    => false,
846
-					'name'       => esc_html__( 'WordPress', 'redux-framework' ),
847
-					'background' => '',
848
-					'color'      => '#21759b',
849
-					'url'        => '',
850
-					'order'      => 74,
851
-				),
852
-				75 => array(
853
-					'id'         => 'xing',
854
-					'icon'       => 'fa-xing',
855
-					'class'      => 'fa',
856
-					'enabled'    => false,
857
-					'name'       => esc_html__( 'Xing', 'redux-framework' ),
858
-					'background' => '',
859
-					'color'      => '#026466',
860
-					'url'        => '',
861
-					'order'      => 75,
862
-				),
863
-				76 => array(
864
-					'id'         => 'xing-square',
865
-					'icon'       => 'fa-xing-square',
866
-					'class'      => 'fa',
867
-					'enabled'    => false,
868
-					'name'       => esc_html__( 'Xing square', 'redux-framework' ),
869
-					'background' => '',
870
-					'color'      => '#026466',
871
-					'url'        => '',
872
-					'order'      => 76,
873
-				),
874
-				77 => array(
875
-					'id'         => 'yahoo',
876
-					'icon'       => 'fa-yahoo',
877
-					'class'      => 'fa',
878
-					'enabled'    => false,
879
-					'name'       => esc_html__( 'Yahoo', 'redux-framework' ),
880
-					'background' => '',
881
-					'color'      => '#400191',
882
-					'url'        => '',
883
-					'order'      => 77,
884
-				),
885
-				78 => array(
886
-					'id'         => 'yelp',
887
-					'icon'       => 'fa-yelp',
888
-					'class'      => 'fa',
889
-					'enabled'    => false,
890
-					'name'       => esc_html__( 'Yelp', 'redux-framework' ),
891
-					'background' => '',
892
-					'color'      => '#C93C27',
893
-					'url'        => '',
894
-					'order'      => 78,
895
-				),
896
-				79 => array(
897
-					'id'         => 'youtube',
898
-					'icon'       => 'fa-youtube',
899
-					'class'      => 'fa',
900
-					'enabled'    => false,
901
-					'name'       => esc_html__( 'YouTube', 'redux-framework' ),
902
-					'background' => '',
903
-					'color'      => '#e52d27',
904
-					'url'        => '',
905
-					'order'      => 79,
906
-				),
907
-				80 => array(
908
-					'id'         => 'youtube-play',
909
-					'icon'       => 'fa-youtube-play',
910
-					'class'      => 'fa',
911
-					'enabled'    => false,
912
-					'name'       => esc_html__( 'YouTube play', 'redux-framework' ),
913
-					'background' => '',
914
-					'color'      => '#e52d27',
915
-					'url'        => '',
916
-					'order'      => 80,
917
-				),
918
-				81 => array(
919
-					'id'         => 'youtube-square',
920
-					'icon'       => 'fa-youtube-square',
921
-					'class'      => 'fa',
922
-					'enabled'    => false,
923
-					'name'       => esc_html__( 'YouTube square', 'redux-framework' ),
924
-					'background' => '',
925
-					'color'      => '#e52d27',
926
-					'url'        => '',
927
-					'order'      => 81,
928
-				),
929
-			);
930
-		}
931
-	}
19
+        /**
20
+         * Get defaults array.
21
+         *
22
+         * @return array
23
+         */
24
+        public static function get_social_media_defaults(): array {
25
+            return array(
26
+                0  => array(
27
+                    'id'         => 'adn',
28
+                    'icon'       => 'fa-adn',
29
+                    'class'      => 'fa',
30
+                    'enabled'    => false,
31
+                    'name'       => esc_html__( 'ADN', 'redux-framework' ),
32
+                    'background' => '',
33
+                    'color'      => '#000000',
34
+                    'url'        => '',
35
+                    'order'      => 0,
36
+                ),
37
+                1  => array(
38
+                    'id'         => 'android',
39
+                    'icon'       => 'fa-android',
40
+                    'class'      => 'fa',
41
+                    'enabled'    => false,
42
+                    'name'       => esc_html__( 'Android', 'redux-framework' ),
43
+                    'background' => '',
44
+                    'color'      => '#A4C639',
45
+                    'url'        => '',
46
+                    'order'      => 1,
47
+                ),
48
+                2  => array(
49
+                    'id'         => 'apple',
50
+                    'icon'       => 'fa-apple',
51
+                    'class'      => 'fa',
52
+                    'enabled'    => false,
53
+                    'name'       => esc_html__( 'Apple', 'redux-framework' ),
54
+                    'style'      => '',
55
+                    'background' => '',
56
+                    'color'      => '#e4e4e5',
57
+                    'url'        => '',
58
+                    'order'      => 2,
59
+                ),
60
+                3  => array(
61
+                    'id'         => 'behance',
62
+                    'icon'       => 'fa-behance',
63
+                    'class'      => 'fa',
64
+                    'enabled'    => false,
65
+                    'name'       => esc_html__( 'behance', 'redux-framework' ),
66
+                    'background' => '',
67
+                    'color'      => '#1769ff',
68
+                    'url'        => '',
69
+                    'order'      => 3,
70
+                ),
71
+                4  => array(
72
+                    'id'         => 'behance-square',
73
+                    'icon'       => 'fa-behance-square',
74
+                    'class'      => 'fa',
75
+                    'enabled'    => false,
76
+                    'name'       => esc_html__( 'behance square', 'redux-framework' ),
77
+                    'background' => '',
78
+                    'color'      => '#1769ff',
79
+                    'url'        => '',
80
+                    'order'      => 4,
81
+                ),
82
+                5  => array(
83
+                    'id'         => 'bitbucket',
84
+                    'icon'       => 'fa-bitbucket',
85
+                    'class'      => 'fa',
86
+                    'enabled'    => false,
87
+                    'name'       => esc_html__( 'Bitbucket', 'redux-framework' ),
88
+                    'background' => '',
89
+                    'color'      => '#205081',
90
+                    'url'        => '',
91
+                    'order'      => 5,
92
+                ),
93
+                6  => array(
94
+                    'id'         => 'bitbucket-square',
95
+                    'icon'       => 'fa-bitbucket-square',
96
+                    'class'      => 'fa',
97
+                    'enabled'    => false,
98
+                    'name'       => esc_html__( 'Bitbucket square', 'redux-framework' ),
99
+                    'background' => '',
100
+                    'color'      => '#205081',
101
+                    'url'        => '',
102
+                    'order'      => 6,
103
+                ),
104
+                7  => array(
105
+                    'id'         => 'bitcoin',
106
+                    'icon'       => 'fa-btc',
107
+                    'class'      => 'fa',
108
+                    'enabled'    => false,
109
+                    'name'       => esc_html__( 'Bitcoin', 'redux-framework' ),
110
+                    'background' => '',
111
+                    'color'      => '#000000',
112
+                    'url'        => '',
113
+                    'order'      => 7,
114
+                ),
115
+                8  => array(
116
+                    'id'         => 'codepen',
117
+                    'icon'       => 'fa-codepen',
118
+                    'class'      => 'fa',
119
+                    'enabled'    => false,
120
+                    'name'       => esc_html__( 'CodePen', 'redux-framework' ),
121
+                    'background' => '',
122
+                    'color'      => '#000000',
123
+                    'url'        => '',
124
+                    'order'      => 8,
125
+                ),
126
+                9  => array(
127
+                    'id'         => 'css3',
128
+                    'icon'       => 'fa-css3',
129
+                    'class'      => 'fa',
130
+                    'enabled'    => false,
131
+                    'name'       => esc_html__( 'CSS3', 'redux-framework' ),
132
+                    'background' => '',
133
+                    'color'      => '#000000',
134
+                    'url'        => '',
135
+                    'order'      => 9,
136
+                ),
137
+                10 => array(
138
+                    'id'         => 'delicious',
139
+                    'icon'       => 'fa-delicious',
140
+                    'class'      => 'fa',
141
+                    'enabled'    => false,
142
+                    'name'       => esc_html__( 'Delicious', 'redux-framework' ),
143
+                    'background' => '',
144
+                    'color'      => '#3399ff',
145
+                    'url'        => '',
146
+                    'order'      => 10,
147
+                ),
148
+                11 => array(
149
+                    'id'         => 'deviantart',
150
+                    'icon'       => 'fa-deviantart',
151
+                    'class'      => 'fa',
152
+                    'enabled'    => false,
153
+                    'name'       => esc_html__( 'Deviantart', 'redux-framework' ),
154
+                    'background' => '',
155
+                    'color'      => '#4e6252',
156
+                    'url'        => '',
157
+                    'order'      => 11,
158
+                ),
159
+                12 => array(
160
+                    'id'         => 'digg',
161
+                    'icon'       => 'fa-digg',
162
+                    'class'      => 'fa',
163
+                    'enabled'    => false,
164
+                    'name'       => esc_html__( 'Digg', 'redux-framework' ),
165
+                    'background' => '',
166
+                    'color'      => '#000000',
167
+                    'url'        => '',
168
+                    'order'      => 12,
169
+                ),
170
+                13 => array(
171
+                    'id'         => 'dribbble',
172
+                    'icon'       => 'fa-dribbble',
173
+                    'class'      => 'fa',
174
+                    'enabled'    => false,
175
+                    'name'       => esc_html__( 'Dribbble', 'redux-framework' ),
176
+                    'background' => '',
177
+                    'color'      => '#444444',
178
+                    'url'        => '',
179
+                    'order'      => 13,
180
+                ),
181
+                14 => array(
182
+                    'id'         => 'dropbox',
183
+                    'icon'       => 'fa-dropbox',
184
+                    'class'      => 'fa',
185
+                    'enabled'    => false,
186
+                    'name'       => esc_html__( 'Dropbox', 'redux-framework' ),
187
+                    'background' => '',
188
+                    'color'      => '#007ee5',
189
+                    'url'        => '',
190
+                    'order'      => 14,
191
+                ),
192
+                15 => array(
193
+                    'id'         => 'drupal',
194
+                    'icon'       => 'fa-drupal',
195
+                    'class'      => 'fa',
196
+                    'enabled'    => false,
197
+                    'name'       => esc_html__( 'Drupal', 'redux-framework' ),
198
+                    'background' => '',
199
+                    'color'      => '#0077c0',
200
+                    'url'        => '',
201
+                    'order'      => 15,
202
+                ),
203
+                16 => array(
204
+                    'id'         => 'empire',
205
+                    'icon'       => 'fa-empire',
206
+                    'class'      => 'fa',
207
+                    'enabled'    => false,
208
+                    'name'       => esc_html__( 'Empire', 'redux-framework' ),
209
+                    'background' => '',
210
+                    'color'      => '#000000',
211
+                    'url'        => '',
212
+                    'order'      => 16,
213
+                ),
214
+                17 => array(
215
+                    'id'         => 'facebook',
216
+                    'icon'       => 'fa-facebook',
217
+                    'class'      => 'fa',
218
+                    'enabled'    => false,
219
+                    'name'       => esc_html__( 'Facebook', 'redux-framework' ),
220
+                    'background' => '',
221
+                    'color'      => '#3b5998',
222
+                    'url'        => '',
223
+                    'order'      => 17,
224
+                ),
225
+                18 => array(
226
+                    'id'         => 'facebook-square',
227
+                    'icon'       => 'fa-facebook-square',
228
+                    'class'      => 'fa',
229
+                    'enabled'    => false,
230
+                    'name'       => esc_html__( 'Facebook square', 'redux-framework' ),
231
+                    'background' => '',
232
+                    'color'      => '#3b5998',
233
+                    'url'        => '',
234
+                    'order'      => 18,
235
+                ),
236
+                19 => array(
237
+                    'id'         => 'flickr',
238
+                    'icon'       => 'fa-flickr',
239
+                    'class'      => 'fa',
240
+                    'enabled'    => false,
241
+                    'name'       => esc_html__( 'Flickr', 'redux-framework' ),
242
+                    'background' => '',
243
+                    'color'      => '#0063dc',
244
+                    'url'        => '',
245
+                    'order'      => 19,
246
+                ),
247
+                20 => array(
248
+                    'id'         => 'foursquare',
249
+                    'icon'       => 'fa-foursquare',
250
+                    'class'      => 'fa',
251
+                    'enabled'    => false,
252
+                    'name'       => esc_html__( 'FourSquare', 'redux-framework' ),
253
+                    'background' => '',
254
+                    'color'      => '#0072b1',
255
+                    'url'        => '',
256
+                    'order'      => 20,
257
+                ),
258
+                21 => array(
259
+                    'id'         => 'git',
260
+                    'icon'       => 'fa-git',
261
+                    'class'      => 'fa',
262
+                    'enabled'    => false,
263
+                    'name'       => esc_html__( 'git', 'redux-framework' ),
264
+                    'background' => '',
265
+                    'color'      => '#000000',
266
+                    'url'        => '',
267
+                    'order'      => 21,
268
+                ),
269
+                22 => array(
270
+                    'id'         => 'git-square',
271
+                    'icon'       => 'fa-git-square',
272
+                    'class'      => 'fa',
273
+                    'enabled'    => false,
274
+                    'name'       => esc_html__( 'git square', 'redux-framework' ),
275
+                    'background' => '',
276
+                    'color'      => '#000000',
277
+                    'url'        => '',
278
+                    'order'      => 22,
279
+                ),
280
+                23 => array(
281
+                    'id'         => 'github',
282
+                    'icon'       => 'fa-github',
283
+                    'class'      => 'fa',
284
+                    'enabled'    => false,
285
+                    'name'       => esc_html__( 'github', 'redux-framework' ),
286
+                    'background' => '',
287
+                    'color'      => '#4183c4',
288
+                    'url'        => '',
289
+                    'order'      => 23,
290
+                ),
291
+                24 => array(
292
+                    'id'         => 'github-alt',
293
+                    'icon'       => 'fa-github-alt',
294
+                    'class'      => 'fa',
295
+                    'enabled'    => false,
296
+                    'name'       => esc_html__( 'github alt', 'redux-framework' ),
297
+                    'background' => '',
298
+                    'color'      => '#4183c4',
299
+                    'url'        => '',
300
+                    'order'      => 24,
301
+                ),
302
+                25 => array(
303
+                    'id'         => 'github-square',
304
+                    'icon'       => 'fa-github-square',
305
+                    'class'      => 'fa',
306
+                    'enabled'    => false,
307
+                    'name'       => esc_html__( 'github square', 'redux-framework' ),
308
+                    'background' => '',
309
+                    'color'      => '#4183c4',
310
+                    'url'        => '',
311
+                    'order'      => 25,
312
+                ),
313
+                26 => array(
314
+                    'id'         => 'gittip',
315
+                    'icon'       => 'fa-gittip',
316
+                    'class'      => 'fa',
317
+                    'enabled'    => false,
318
+                    'name'       => esc_html__( 'git tip', 'redux-framework' ),
319
+                    'background' => '',
320
+                    'color'      => '#000000',
321
+                    'url'        => '',
322
+                    'order'      => 26,
323
+                ),
324
+                27 => array(
325
+                    'id'         => 'google',
326
+                    'icon'       => 'fa-google',
327
+                    'class'      => 'fa',
328
+                    'enabled'    => false,
329
+                    'name'       => esc_html__( 'Google', 'redux-framework' ),
330
+                    'background' => '',
331
+                    'color'      => '#dd4b39',
332
+                    'url'        => '',
333
+                    'order'      => 27,
334
+                ),
335
+                28 => array(
336
+                    'id'         => 'google-plus',
337
+                    'icon'       => 'fa-google-plus',
338
+                    'class'      => 'fa',
339
+                    'enabled'    => false,
340
+                    'name'       => esc_html__( 'Google Plus', 'redux-framework' ),
341
+                    'background' => '',
342
+                    'color'      => '#dd4b39',
343
+                    'url'        => '',
344
+                    'order'      => 28,
345
+                ),
346
+                29 => array(
347
+                    'id'         => 'google-plus-square',
348
+                    'icon'       => 'fa-google-plus-square',
349
+                    'class'      => 'fa',
350
+                    'enabled'    => false,
351
+                    'name'       => esc_html__( 'Google Plus square', 'redux-framework' ),
352
+                    'background' => '',
353
+                    'color'      => '#dd4b39',
354
+                    'url'        => '',
355
+                    'order'      => 29,
356
+                ),
357
+                30 => array(
358
+                    'id'         => 'hacker-news',
359
+                    'icon'       => 'fa-hacker-news',
360
+                    'class'      => 'fa',
361
+                    'enabled'    => false,
362
+                    'name'       => esc_html__( 'Hacker News', 'redux-framework' ),
363
+                    'background' => '',
364
+                    'color'      => '#ff6600',
365
+                    'url'        => '',
366
+                    'order'      => 30,
367
+                ),
368
+                31 => array(
369
+                    'id'         => 'html5',
370
+                    'icon'       => 'fa-html5',
371
+                    'class'      => 'fa',
372
+                    'enabled'    => false,
373
+                    'name'       => esc_html__( 'HTML5', 'redux-framework' ),
374
+                    'background' => '',
375
+                    'color'      => '#e34f26',
376
+                    'url'        => '',
377
+                    'order'      => 31,
378
+                ),
379
+                32 => array(
380
+                    'id'         => 'instagram',
381
+                    'icon'       => 'fa-instagram',
382
+                    'class'      => 'fa',
383
+                    'enabled'    => false,
384
+                    'name'       => esc_html__( 'Instagram', 'redux-framework' ),
385
+                    'background' => '',
386
+                    'color'      => '#3f729b',
387
+                    'url'        => '',
388
+                    'order'      => 32,
389
+                ),
390
+                33 => array(
391
+                    'id'         => 'joomla',
392
+                    'icon'       => 'fa-joomla',
393
+                    'class'      => 'fa',
394
+                    'enabled'    => false,
395
+                    'name'       => esc_html__( 'Joomla', 'redux-framework' ),
396
+                    'background' => '',
397
+                    'color'      => '#000000',
398
+                    'url'        => '',
399
+                    'order'      => 33,
400
+                ),
401
+                34 => array(
402
+                    'id'         => 'jsfiddle',
403
+                    'icon'       => 'fa-jsfiddle',
404
+                    'class'      => 'fa',
405
+                    'enabled'    => false,
406
+                    'name'       => esc_html__( 'JS Fiddle', 'redux-framework' ),
407
+                    'background' => '',
408
+                    'color'      => '#000000',
409
+                    'url'        => '',
410
+                    'order'      => 34,
411
+                ),
412
+                35 => array(
413
+                    'id'         => 'linkedin',
414
+                    'icon'       => 'fa-linkedin',
415
+                    'class'      => 'fa',
416
+                    'enabled'    => false,
417
+                    'name'       => esc_html__( 'LinkedIn', 'redux-framework' ),
418
+                    'background' => '',
419
+                    'color'      => '#0976b4',
420
+                    'url'        => '',
421
+                    'order'      => 35,
422
+                ),
423
+                36 => array(
424
+                    'id'         => 'linkedin-square',
425
+                    'icon'       => 'fa-linkedin-square',
426
+                    'class'      => 'fa',
427
+                    'enabled'    => false,
428
+                    'name'       => esc_html__( 'LinkedIn square', 'redux-framework' ),
429
+                    'background' => '',
430
+                    'color'      => '#0976b4',
431
+                    'url'        => '',
432
+                    'order'      => 36,
433
+                ),
434
+                37 => array(
435
+                    'id'         => 'linux',
436
+                    'icon'       => 'fa-linux',
437
+                    'class'      => 'fa',
438
+                    'enabled'    => false,
439
+                    'name'       => esc_html__( 'Linux', 'redux-framework' ),
440
+                    'background' => '',
441
+                    'color'      => '#333333',
442
+                    'url'        => '',
443
+                    'order'      => 37,
444
+                ),
445
+                38 => array(
446
+                    'id'         => 'maxcdn',
447
+                    'icon'       => 'fa-maxcdn',
448
+                    'class'      => 'fa',
449
+                    'enabled'    => false,
450
+                    'name'       => esc_html__( 'MaxCDN', 'redux-framework' ),
451
+                    'background' => '',
452
+                    'color'      => '#f8711e',
453
+                    'url'        => '',
454
+                    'order'      => 38,
455
+                ),
456
+                39 => array(
457
+                    'id'         => 'openid',
458
+                    'icon'       => 'fa-openid',
459
+                    'class'      => 'fa',
460
+                    'enabled'    => false,
461
+                    'name'       => esc_html__( 'OpenID', 'redux-framework' ),
462
+                    'background' => '',
463
+                    'color'      => '#000000',
464
+                    'url'        => '',
465
+                    'order'      => 39,
466
+                ),
467
+                40 => array(
468
+                    'id'         => 'pagelines',
469
+                    'icon'       => 'fa-pagelines',
470
+                    'class'      => 'fa',
471
+                    'enabled'    => false,
472
+                    'name'       => esc_html__( 'Page Lines', 'redux-framework' ),
473
+                    'background' => '',
474
+                    'color'      => '#000000',
475
+                    'url'        => '',
476
+                    'order'      => 40,
477
+                ),
478
+                41 => array(
479
+                    'id'         => 'pied-piper',
480
+                    'icon'       => 'fa-pied-piper',
481
+                    'class'      => 'fa',
482
+                    'enabled'    => false,
483
+                    'name'       => esc_html__( 'Pied Piper', 'redux-framework' ),
484
+                    'background' => '',
485
+                    'color'      => '#000000',
486
+                    'url'        => '',
487
+                    'order'      => 41,
488
+                ),
489
+                42 => array(
490
+                    'id'         => 'pied-piper-alt',
491
+                    'icon'       => 'fa-pied-piper-alt',
492
+                    'class'      => 'fa',
493
+                    'enabled'    => false,
494
+                    'name'       => esc_html__( 'Pied Piper alt', 'redux-framework' ),
495
+                    'background' => '',
496
+                    'color'      => '#000000',
497
+                    'url'        => '',
498
+                    'order'      => 42,
499
+                ),
500
+                43 => array(
501
+                    'id'         => 'pinterest',
502
+                    'icon'       => 'fa-pinterest',
503
+                    'class'      => 'fa',
504
+                    'enabled'    => false,
505
+                    'name'       => esc_html__( 'Pinterest', 'redux-framework' ),
506
+                    'background' => '',
507
+                    'color'      => '#1769ff',
508
+                    'url'        => '',
509
+                    'order'      => 43,
510
+                ),
511
+                44 => array(
512
+                    'id'         => 'pinterest-square',
513
+                    'icon'       => 'fa-pinterest-square',
514
+                    'class'      => 'fa',
515
+                    'enabled'    => false,
516
+                    'name'       => esc_html__( 'Pinterest square', 'redux-framework' ),
517
+                    'background' => '',
518
+                    'color'      => '#1769ff',
519
+                    'url'        => '',
520
+                    'order'      => 44,
521
+                ),
522
+                45 => array(
523
+                    'id'         => 'qq',
524
+                    'icon'       => 'fa-qq',
525
+                    'class'      => 'fa',
526
+                    'enabled'    => false,
527
+                    'name'       => esc_html__( 'QQ', 'redux-framework' ),
528
+                    'background' => '',
529
+                    'color'      => '#000000',
530
+                    'url'        => '',
531
+                    'order'      => 45,
532
+                ),
533
+                46 => array(
534
+                    'id'         => 'rebel',
535
+                    'icon'       => 'fa-rebel',
536
+                    'class'      => 'fa',
537
+                    'enabled'    => false,
538
+                    'name'       => esc_html__( 'Rebel', 'redux-framework' ),
539
+                    'background' => '',
540
+                    'color'      => '#517fa4',
541
+                    'url'        => '',
542
+                    'order'      => 46,
543
+                ),
544
+                47 => array(
545
+                    'id'         => 'reddit',
546
+                    'icon'       => 'fa-reddit',
547
+                    'class'      => 'fa',
548
+                    'enabled'    => false,
549
+                    'name'       => esc_html__( 'Reddit', 'redux-framework' ),
550
+                    'background' => '',
551
+                    'color'      => '#ff4500',
552
+                    'url'        => '',
553
+                    'order'      => 47,
554
+                ),
555
+                48 => array(
556
+                    'id'         => 'reddit-square',
557
+                    'icon'       => 'fa-reddit-square',
558
+                    'class'      => 'fa',
559
+                    'enabled'    => false,
560
+                    'name'       => esc_html__( 'Reddit square', 'redux-framework' ),
561
+                    'background' => '',
562
+                    'color'      => '#ff4500',
563
+                    'url'        => '',
564
+                    'order'      => 48,
565
+                ),
566
+                49 => array(
567
+                    'id'         => 'renren',
568
+                    'icon'       => 'fa-renren',
569
+                    'class'      => 'fa',
570
+                    'enabled'    => false,
571
+                    'name'       => esc_html__( 'Ren Ren', 'redux-framework' ),
572
+                    'background' => '',
573
+                    'color'      => '#007bb6',
574
+                    'url'        => '',
575
+                    'order'      => 49,
576
+                ),
577
+                50 => array(
578
+                    'id'         => 'share-alt',
579
+                    'icon'       => 'fa-share-alt',
580
+                    'class'      => 'fa',
581
+                    'enabled'    => false,
582
+                    'name'       => esc_html__( 'Share alt', 'redux-framework' ),
583
+                    'background' => '',
584
+                    'color'      => '#000000',
585
+                    'url'        => '',
586
+                    'order'      => 50,
587
+                ),
588
+                51 => array(
589
+                    'id'         => 'share-alt-square',
590
+                    'icon'       => 'fa-share-alt-square',
591
+                    'class'      => 'fa',
592
+                    'enabled'    => false,
593
+                    'name'       => esc_html__( 'Share square', 'redux-framework' ),
594
+                    'background' => '',
595
+                    'color'      => '#000000',
596
+                    'url'        => '',
597
+                    'order'      => 51,
598
+                ),
599
+                52 => array(
600
+                    'id'         => 'skype',
601
+                    'icon'       => 'fa-skype',
602
+                    'class'      => 'fa',
603
+                    'enabled'    => false,
604
+                    'name'       => esc_html__( 'Skype', 'redux-framework' ),
605
+                    'background' => '',
606
+                    'color'      => '#00aff0',
607
+                    'url'        => '',
608
+                    'order'      => 52,
609
+                ),
610
+                53 => array(
611
+                    'id'         => 'slack',
612
+                    'icon'       => 'fa-slack',
613
+                    'class'      => 'fa',
614
+                    'enabled'    => false,
615
+                    'name'       => esc_html__( 'Slack', 'redux-framework' ),
616
+                    'background' => '',
617
+                    'color'      => '#000000',
618
+                    'url'        => '',
619
+                    'order'      => 53,
620
+                ),
621
+                54 => array(
622
+                    'id'         => 'soundcloud',
623
+                    'icon'       => 'fa-soundcloud',
624
+                    'class'      => 'fa',
625
+                    'enabled'    => false,
626
+                    'name'       => esc_html__( 'Sound Cloud', 'redux-framework' ),
627
+                    'background' => '',
628
+                    'color'      => '#f80',
629
+                    'url'        => '',
630
+                    'order'      => 54,
631
+                ),
632
+                55 => array(
633
+                    'id'         => 'spotify',
634
+                    'icon'       => 'fa-spotify',
635
+                    'class'      => 'fa',
636
+                    'enabled'    => false,
637
+                    'name'       => esc_html__( 'Spotify', 'redux-framework' ),
638
+                    'background' => '',
639
+                    'color'      => '#7ab800',
640
+                    'url'        => '',
641
+                    'order'      => 55,
642
+                ),
643
+                56 => array(
644
+                    'id'         => 'stack-exchange',
645
+                    'icon'       => 'fa-stack-exchange',
646
+                    'class'      => 'fa',
647
+                    'enabled'    => false,
648
+                    'name'       => esc_html__( 'Stack Exchange', 'redux-framework' ),
649
+                    'background' => '',
650
+                    'color'      => '#000000',
651
+                    'url'        => '',
652
+                    'order'      => 56,
653
+                ),
654
+                57 => array(
655
+                    'id'         => 'stack-overflow',
656
+                    'icon'       => 'fa-stack-overflow',
657
+                    'class'      => 'fa',
658
+                    'enabled'    => false,
659
+                    'name'       => esc_html__( 'Stack Overflow', 'redux-framework' ),
660
+                    'background' => '',
661
+                    'color'      => '#fe7a15',
662
+                    'url'        => '',
663
+                    'order'      => 57,
664
+                ),
665
+                58 => array(
666
+                    'id'         => 'steam',
667
+                    'icon'       => 'fa-steam',
668
+                    'class'      => 'fa',
669
+                    'enabled'    => false,
670
+                    'name'       => esc_html__( 'Steam', 'redux-framework' ),
671
+                    'background' => '',
672
+                    'color'      => '#000000',
673
+                    'url'        => '',
674
+                    'order'      => 58,
675
+                ),
676
+                59 => array(
677
+                    'id'         => 'steam-square',
678
+                    'icon'       => 'fa-steam-square',
679
+                    'class'      => 'fa',
680
+                    'enabled'    => false,
681
+                    'name'       => esc_html__( 'Steam square', 'redux-framework' ),
682
+                    'background' => '',
683
+                    'color'      => '#000000',
684
+                    'url'        => '',
685
+                    'order'      => 59,
686
+                ),
687
+                60 => array(
688
+                    'id'         => 'stumbleupon',
689
+                    'icon'       => 'fa-stumbleupon',
690
+                    'class'      => 'fa',
691
+                    'enabled'    => false,
692
+                    'name'       => esc_html__( 'Stumble Upon', 'redux-framework' ),
693
+                    'background' => '',
694
+                    'color'      => '#eb4924',
695
+                    'url'        => '',
696
+                    'order'      => 60,
697
+                ),
698
+                61 => array(
699
+                    'id'         => 'stumbleupon-circle',
700
+                    'icon'       => 'fa-stumbleupon-circle',
701
+                    'class'      => 'fa',
702
+                    'enabled'    => false,
703
+                    'name'       => esc_html__( 'Stumble Upon circle', 'redux-framework' ),
704
+                    'background' => '',
705
+                    'color'      => '#eb4924',
706
+                    'url'        => '',
707
+                    'order'      => 61,
708
+                ),
709
+                62 => array(
710
+                    'id'         => 'tencent-weibo',
711
+                    'icon'       => 'fa-tencent-weibo',
712
+                    'class'      => 'fa',
713
+                    'enabled'    => false,
714
+                    'name'       => esc_html__( 'Tencent Weibo', 'redux-framework' ),
715
+                    'background' => '',
716
+                    'color'      => '#000000',
717
+                    'url'        => '',
718
+                    'order'      => 62,
719
+                ),
720
+                63 => array(
721
+                    'id'         => 'trello',
722
+                    'icon'       => 'fa-trello',
723
+                    'class'      => 'fa',
724
+                    'enabled'    => false,
725
+                    'name'       => esc_html__( 'Trello', 'redux-framework' ),
726
+                    'background' => '',
727
+                    'color'      => '#256a92',
728
+                    'url'        => '',
729
+                    'order'      => 63,
730
+                ),
731
+                64 => array(
732
+                    'id'         => 'tumblr',
733
+                    'icon'       => 'fa-tumblr',
734
+                    'class'      => 'fa',
735
+                    'enabled'    => false,
736
+                    'name'       => esc_html__( 'Tumblr', 'redux-framework' ),
737
+                    'background' => '',
738
+                    'color'      => '#35465c',
739
+                    'url'        => '',
740
+                    'order'      => 64,
741
+                ),
742
+                65 => array(
743
+                    'id'         => 'tumblr-square',
744
+                    'icon'       => 'fa-tumblr-square',
745
+                    'class'      => 'fa',
746
+                    'enabled'    => false,
747
+                    'name'       => esc_html__( 'Tumblr square', 'redux-framework' ),
748
+                    'background' => '',
749
+                    'color'      => '#35465c',
750
+                    'url'        => '',
751
+                    'order'      => 65,
752
+                ),
753
+                66 => array(
754
+                    'id'         => 'twitter',
755
+                    'icon'       => 'fa-x-twitter',
756
+                    'class'      => 'fa-brands',
757
+                    'enabled'    => false,
758
+                    'name'       => esc_html__( 'X', 'redux-framework' ),
759
+                    'background' => '',
760
+                    'color'      => '#55acee',
761
+                    'url'        => '',
762
+                    'order'      => 66,
763
+                ),
764
+                67 => array(
765
+                    'id'         => 'twitter-square',
766
+                    'icon'       => 'fa-square-x-twitter',
767
+                    'class'      => 'fa-brands',
768
+                    'enabled'    => false,
769
+                    'name'       => esc_html__( 'X square', 'redux-framework' ),
770
+                    'background' => '',
771
+                    'color'      => '#55acee',
772
+                    'url'        => '',
773
+                    'order'      => 67,
774
+                ),
775
+                68 => array(
776
+                    'id'         => 'vimeo-square',
777
+                    'icon'       => 'fa-vimeo-square',
778
+                    'class'      => 'fa',
779
+                    'enabled'    => false,
780
+                    'name'       => esc_html__( 'Vimeo square', 'redux-framework' ),
781
+                    'background' => '',
782
+                    'color'      => '#1ab7ea',
783
+                    'url'        => '',
784
+                    'order'      => 68,
785
+                ),
786
+                69 => array(
787
+                    'id'         => 'vine',
788
+                    'icon'       => 'fa-vine',
789
+                    'class'      => 'fa',
790
+                    'enabled'    => false,
791
+                    'name'       => esc_html__( 'Vine', 'redux-framework' ),
792
+                    'background' => '',
793
+                    'color'      => '#00b488',
794
+                    'url'        => '',
795
+                    'order'      => 69,
796
+                ),
797
+                70 => array(
798
+                    'id'         => 'vk',
799
+                    'icon'       => 'fa-vk',
800
+                    'class'      => 'fa',
801
+                    'enabled'    => false,
802
+                    'name'       => esc_html__( 'VK', 'redux-framework' ),
803
+                    'background' => '',
804
+                    'color'      => '#000000',
805
+                    'url'        => '',
806
+                    'order'      => 70,
807
+                ),
808
+                71 => array(
809
+                    'id'         => 'weibo',
810
+                    'icon'       => 'fa-weibo',
811
+                    'class'      => 'fa',
812
+                    'enabled'    => false,
813
+                    'name'       => esc_html__( 'Weibo', 'redux-framework' ),
814
+                    'background' => '',
815
+                    'color'      => '#000000',
816
+                    'url'        => '',
817
+                    'order'      => 71,
818
+                ),
819
+                72 => array(
820
+                    'id'         => 'weixin',
821
+                    'icon'       => 'fa-weixin',
822
+                    'class'      => 'fa',
823
+                    'enabled'    => false,
824
+                    'name'       => esc_html__( 'Weixin', 'redux-framework' ),
825
+                    'background' => '',
826
+                    'color'      => '#000000',
827
+                    'url'        => '',
828
+                    'order'      => 72,
829
+                ),
830
+                73 => array(
831
+                    'id'         => 'windows',
832
+                    'icon'       => 'fa-windows',
833
+                    'class'      => 'fa',
834
+                    'enabled'    => false,
835
+                    'name'       => esc_html__( 'Windows', 'redux-framework' ),
836
+                    'background' => '',
837
+                    'color'      => '#00bcf2',
838
+                    'url'        => '',
839
+                    'order'      => 73,
840
+                ),
841
+                74 => array(
842
+                    'id'         => 'wordpress',
843
+                    'icon'       => 'fa-wordpress',
844
+                    'class'      => 'fa',
845
+                    'enabled'    => false,
846
+                    'name'       => esc_html__( 'WordPress', 'redux-framework' ),
847
+                    'background' => '',
848
+                    'color'      => '#21759b',
849
+                    'url'        => '',
850
+                    'order'      => 74,
851
+                ),
852
+                75 => array(
853
+                    'id'         => 'xing',
854
+                    'icon'       => 'fa-xing',
855
+                    'class'      => 'fa',
856
+                    'enabled'    => false,
857
+                    'name'       => esc_html__( 'Xing', 'redux-framework' ),
858
+                    'background' => '',
859
+                    'color'      => '#026466',
860
+                    'url'        => '',
861
+                    'order'      => 75,
862
+                ),
863
+                76 => array(
864
+                    'id'         => 'xing-square',
865
+                    'icon'       => 'fa-xing-square',
866
+                    'class'      => 'fa',
867
+                    'enabled'    => false,
868
+                    'name'       => esc_html__( 'Xing square', 'redux-framework' ),
869
+                    'background' => '',
870
+                    'color'      => '#026466',
871
+                    'url'        => '',
872
+                    'order'      => 76,
873
+                ),
874
+                77 => array(
875
+                    'id'         => 'yahoo',
876
+                    'icon'       => 'fa-yahoo',
877
+                    'class'      => 'fa',
878
+                    'enabled'    => false,
879
+                    'name'       => esc_html__( 'Yahoo', 'redux-framework' ),
880
+                    'background' => '',
881
+                    'color'      => '#400191',
882
+                    'url'        => '',
883
+                    'order'      => 77,
884
+                ),
885
+                78 => array(
886
+                    'id'         => 'yelp',
887
+                    'icon'       => 'fa-yelp',
888
+                    'class'      => 'fa',
889
+                    'enabled'    => false,
890
+                    'name'       => esc_html__( 'Yelp', 'redux-framework' ),
891
+                    'background' => '',
892
+                    'color'      => '#C93C27',
893
+                    'url'        => '',
894
+                    'order'      => 78,
895
+                ),
896
+                79 => array(
897
+                    'id'         => 'youtube',
898
+                    'icon'       => 'fa-youtube',
899
+                    'class'      => 'fa',
900
+                    'enabled'    => false,
901
+                    'name'       => esc_html__( 'YouTube', 'redux-framework' ),
902
+                    'background' => '',
903
+                    'color'      => '#e52d27',
904
+                    'url'        => '',
905
+                    'order'      => 79,
906
+                ),
907
+                80 => array(
908
+                    'id'         => 'youtube-play',
909
+                    'icon'       => 'fa-youtube-play',
910
+                    'class'      => 'fa',
911
+                    'enabled'    => false,
912
+                    'name'       => esc_html__( 'YouTube play', 'redux-framework' ),
913
+                    'background' => '',
914
+                    'color'      => '#e52d27',
915
+                    'url'        => '',
916
+                    'order'      => 80,
917
+                ),
918
+                81 => array(
919
+                    'id'         => 'youtube-square',
920
+                    'icon'       => 'fa-youtube-square',
921
+                    'class'      => 'fa',
922
+                    'enabled'    => false,
923
+                    'name'       => esc_html__( 'YouTube square', 'redux-framework' ),
924
+                    'background' => '',
925
+                    'color'      => '#e52d27',
926
+                    'url'        => '',
927
+                    'order'      => 81,
928
+                ),
929
+            );
930
+        }
931
+    }
932 932
 }
Please login to merge, or discard this patch.
extensions/social_profiles/social_profiles/class-redux-social-profiles.php 2 patches
Indentation   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -11,358 +11,358 @@
 block discarded – undo
11 11
 
12 12
 if ( ! class_exists( 'Redux_Social_Profiles' ) ) {
13 13
 
14
-	/**
15
-	 * Main Redux_Social_Profiles class
16
-	 *
17
-	 * @since       1.0.0
18
-	 */
19
-	class Redux_Social_Profiles extends Redux_Field {
20
-
21
-		/**
22
-		 * Field ID.
23
-		 *
24
-		 * @var null|string
25
-		 */
26
-		public ?string $field_id;
27
-
28
-		/**
29
-		 * Panel opt_name.
30
-		 *
31
-		 * @var null|string
32
-		 */
33
-		public ?string $opt_name;
34
-
35
-		/**
36
-		 * Defaults array.
37
-		 *
38
-		 * @var null|array
39
-		 */
40
-
41
-		private ?array $defaults = array();
42
-
43
-		/**
44
-		 * Set defaults.
45
-		 */
46
-		public function set_defaults() {
47
-			$this->opt_name = $this->parent->args['opt_name'];
48
-			$this->field_id = $this->field['id'];
49
-
50
-			$this->defaults = Redux_Social_Profiles_Functions::get_default_data();
51
-		}
52
-
53
-		/**
54
-		 * Rebuild Settings.
55
-		 *
56
-		 * @param array $settings Settings array.
57
-		 *
58
-		 * @return array
59
-		 */
60
-		private function rebuild_setttings( array $settings ): array {
61
-			$fixed_arr = array();
62
-			$stock     = '';
63
-
64
-			foreach ( $this->defaults as $key => $arr ) {
65
-				$search_default = true;
66
-
67
-				$default_id = $arr['id'];
68
-
69
-				foreach ( $settings as $a ) {
70
-					if ( isset( $a['data'] ) ) {
71
-						$a['data'] = rawurldecode( $a['data'] );
72
-						$a         = (array) json_decode( $a['data'] );
73
-					}
74
-
75
-					if ( $default_id === $a['id'] ) {
76
-						$search_default    = false;
77
-						$fixed_arr[ $key ] = $a;
78
-						break;
79
-					}
80
-				}
81
-
82
-				if ( $search_default ) {
83
-					if ( '' === $stock ) {
84
-						$stock = Redux_Social_Profiles_Defaults::get_social_media_defaults();
85
-						$stock = Redux_Social_Profiles_Functions::add_extra_icons( $stock );
86
-					}
87
-
88
-					foreach ( $stock as $def_arr ) {
89
-						if ( $default_id === $def_arr['id'] ) {
90
-							$fixed_arr[ $key ] = $def_arr;
91
-							break;
92
-						}
93
-					}
94
-				}
95
-			}
96
-
97
-			return $fixed_arr;
98
-		}
99
-
100
-		/**
101
-		 * Field Render Function.
102
-		 * Takes the vars and outputs the HTML for the field in the settings
103
-		 *
104
-		 * @since       1.0.0
105
-		 * @access      public
106
-		 * @return      void
107
-		 */
108
-		public function render() {
109
-			if ( empty( $this->field ) ) {
110
-				return;
111
-			}
112
-
113
-			global $pagenow, $post;
114
-
115
-			$redux_settings = get_option( $this->opt_name );
116
-			$settings       = $redux_settings[ $this->field_id ] ?? array();
117
-
118
-			if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) {
119
-				$post_settings = get_post_meta( $post->ID, $this->field_id, true );
120
-
121
-				if ( ! empty( $post_settings ) ) {
122
-					$settings = $post_settings;
123
-				}
124
-			}
125
-
126
-			$color_pickers = $this->field['color_pickers'] ?? true;
127
-
128
-			// Icon container.
129
-			echo '<div
14
+    /**
15
+     * Main Redux_Social_Profiles class
16
+     *
17
+     * @since       1.0.0
18
+     */
19
+    class Redux_Social_Profiles extends Redux_Field {
20
+
21
+        /**
22
+         * Field ID.
23
+         *
24
+         * @var null|string
25
+         */
26
+        public ?string $field_id;
27
+
28
+        /**
29
+         * Panel opt_name.
30
+         *
31
+         * @var null|string
32
+         */
33
+        public ?string $opt_name;
34
+
35
+        /**
36
+         * Defaults array.
37
+         *
38
+         * @var null|array
39
+         */
40
+
41
+        private ?array $defaults = array();
42
+
43
+        /**
44
+         * Set defaults.
45
+         */
46
+        public function set_defaults() {
47
+            $this->opt_name = $this->parent->args['opt_name'];
48
+            $this->field_id = $this->field['id'];
49
+
50
+            $this->defaults = Redux_Social_Profiles_Functions::get_default_data();
51
+        }
52
+
53
+        /**
54
+         * Rebuild Settings.
55
+         *
56
+         * @param array $settings Settings array.
57
+         *
58
+         * @return array
59
+         */
60
+        private function rebuild_setttings( array $settings ): array {
61
+            $fixed_arr = array();
62
+            $stock     = '';
63
+
64
+            foreach ( $this->defaults as $key => $arr ) {
65
+                $search_default = true;
66
+
67
+                $default_id = $arr['id'];
68
+
69
+                foreach ( $settings as $a ) {
70
+                    if ( isset( $a['data'] ) ) {
71
+                        $a['data'] = rawurldecode( $a['data'] );
72
+                        $a         = (array) json_decode( $a['data'] );
73
+                    }
74
+
75
+                    if ( $default_id === $a['id'] ) {
76
+                        $search_default    = false;
77
+                        $fixed_arr[ $key ] = $a;
78
+                        break;
79
+                    }
80
+                }
81
+
82
+                if ( $search_default ) {
83
+                    if ( '' === $stock ) {
84
+                        $stock = Redux_Social_Profiles_Defaults::get_social_media_defaults();
85
+                        $stock = Redux_Social_Profiles_Functions::add_extra_icons( $stock );
86
+                    }
87
+
88
+                    foreach ( $stock as $def_arr ) {
89
+                        if ( $default_id === $def_arr['id'] ) {
90
+                            $fixed_arr[ $key ] = $def_arr;
91
+                            break;
92
+                        }
93
+                    }
94
+                }
95
+            }
96
+
97
+            return $fixed_arr;
98
+        }
99
+
100
+        /**
101
+         * Field Render Function.
102
+         * Takes the vars and outputs the HTML for the field in the settings
103
+         *
104
+         * @since       1.0.0
105
+         * @access      public
106
+         * @return      void
107
+         */
108
+        public function render() {
109
+            if ( empty( $this->field ) ) {
110
+                return;
111
+            }
112
+
113
+            global $pagenow, $post;
114
+
115
+            $redux_settings = get_option( $this->opt_name );
116
+            $settings       = $redux_settings[ $this->field_id ] ?? array();
117
+
118
+            if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) {
119
+                $post_settings = get_post_meta( $post->ID, $this->field_id, true );
120
+
121
+                if ( ! empty( $post_settings ) ) {
122
+                    $settings = $post_settings;
123
+                }
124
+            }
125
+
126
+            $color_pickers = $this->field['color_pickers'] ?? true;
127
+
128
+            // Icon container.
129
+            echo '<div
130 130
                     class="redux-social-profiles-container ' . esc_attr( $this->field['class'] ) . '"
131 131
                     data-opt-name="' . esc_attr( $this->opt_name ) . '"
132 132
                     data-id="' . esc_attr( $this->field_id ) . '"
133 133
                   >';
134 134
 
135
-			$show_msg = $this->field['hide_widget_msg'] ?? true;
135
+            $show_msg = $this->field['hide_widget_msg'] ?? true;
136 136
 
137
-			// translators: %1$s: Widget page HTML/URL. %s: widget admin URL.
138
-			$def_msg = sprintf( esc_html__( 'Go to the %1$s page to add the Redux Social Widget to any active widget area.', 'redux-framework' ), sprintf( '<a href="%s">' . esc_html__( 'Widgets', 'redux-framework' ) . '</a> ', admin_url( 'widgets.php' ) ) );
137
+            // translators: %1$s: Widget page HTML/URL. %s: widget admin URL.
138
+            $def_msg = sprintf( esc_html__( 'Go to the %1$s page to add the Redux Social Widget to any active widget area.', 'redux-framework' ), sprintf( '<a href="%s">' . esc_html__( 'Widgets', 'redux-framework' ) . '</a> ', admin_url( 'widgets.php' ) ) );
139 139
 
140
-			$msg = $this->field['widget_msg'] ?? $def_msg;
140
+            $msg = $this->field['widget_msg'] ?? $def_msg;
141 141
 
142
-			if ( ! $show_msg ) {
143
-				echo '<div class="redux-social-profiles-header">';
144
-				echo $msg; // phpcs:ignore WordPress.Security.EscapeOutput
145
-				echo '</div>';
146
-			}
142
+            if ( ! $show_msg ) {
143
+                echo '<div class="redux-social-profiles-header">';
144
+                echo $msg; // phpcs:ignore WordPress.Security.EscapeOutput
145
+                echo '</div>';
146
+            }
147 147
 
148
-			echo '<div class="redux-social-profiles-selector-container">';
149
-			echo '<ul id="redux-social-profiles-selector-list">';
148
+            echo '<div class="redux-social-profiles-selector-container">';
149
+            echo '<ul id="redux-social-profiles-selector-list">';
150 150
 
151
-			$settings = $this->rebuild_setttings( $settings );
151
+            $settings = $this->rebuild_setttings( $settings );
152 152
 
153
-			foreach ( $this->defaults as $key => $social_provider_default ) {
154
-				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
153
+            foreach ( $this->defaults as $key => $social_provider_default ) {
154
+                $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
155 155
 
156
-				$icon    = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
157
-				$name    = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name'];
158
-				$class   = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class'];
159
-				$order   = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key;
160
-				$order   = intval( $order );
161
-				$enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled'];
162
-				$display = ( $enabled ) ? 'enabled' : '';
156
+                $icon    = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
157
+                $name    = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name'];
158
+                $class   = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class'];
159
+                $order   = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key;
160
+                $order   = intval( $order );
161
+                $enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled'];
162
+                $display = ( $enabled ) ? 'enabled' : '';
163 163
 
164
-				echo '<li class="redux-social-profiles-item-enable ' . esc_attr( $display ) . '" id="redux-social-profiles-item-enable-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-order="' . esc_attr( $order ) . '">';
165
-				Redux_Social_Profiles_Functions::render_icon( $class, $icon, '', '', $name );
166
-				echo '</li>';
167
-			}
164
+                echo '<li class="redux-social-profiles-item-enable ' . esc_attr( $display ) . '" id="redux-social-profiles-item-enable-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-order="' . esc_attr( $order ) . '">';
165
+                Redux_Social_Profiles_Functions::render_icon( $class, $icon, '', '', $name );
166
+                echo '</li>';
167
+            }
168 168
 
169
-			echo '</ul>';
170
-			echo '</div>';
169
+            echo '</ul>';
170
+            echo '</div>';
171 171
 
172
-			echo '<ul id="redux-social-profiles-list">';
172
+            echo '<ul id="redux-social-profiles-list">';
173 173
 
174
-			foreach ( $this->defaults as $key => $social_provider_default ) {
175
-				echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">';
176
-				echo '<div class="redux-social-item-container">';
174
+            foreach ( $this->defaults as $key => $social_provider_default ) {
175
+                echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">';
176
+                echo '<div class="redux-social-item-container">';
177 177
 
178
-				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
179
-				$icon                   = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
180
-				$id                     = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id'];
181
-				$class                  = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class'];
182
-				$enabled                = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled'];
183
-				$name                   = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name'];
178
+                $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
179
+                $icon                   = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
180
+                $id                     = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id'];
181
+                $class                  = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class'];
182
+                $enabled                = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled'];
183
+                $name                   = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name'];
184 184
 
185
-				$label = ( $social_provider_option && array_key_exists( 'label', $social_provider_option ) && $social_provider_option['label'] ) ? $social_provider_option['label'] : __( 'Link URL', 'redux-framework' );
185
+                $label = ( $social_provider_option && array_key_exists( 'label', $social_provider_option ) && $social_provider_option['label'] ) ? $social_provider_option['label'] : __( 'Link URL', 'redux-framework' );
186 186
 
187
-				$color = ( $social_provider_option && array_key_exists( 'color', $social_provider_option ) ) ? $social_provider_option['color'] : $social_provider_default['color'];
188
-				$color = esc_attr( $color );
187
+                $color = ( $social_provider_option && array_key_exists( 'color', $social_provider_option ) ) ? $social_provider_option['color'] : $social_provider_default['color'];
188
+                $color = esc_attr( $color );
189 189
 
190
-				$background = ( $social_provider_option && array_key_exists( 'background', $social_provider_option ) ) ? $social_provider_option['background'] : $social_provider_default['background'];
191
-				$background = esc_attr( $background );
190
+                $background = ( $social_provider_option && array_key_exists( 'background', $social_provider_option ) ) ? $social_provider_option['background'] : $social_provider_default['background'];
191
+                $background = esc_attr( $background );
192 192
 
193
-				$order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key;
194
-				$order = intval( $order );
193
+                $order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key;
194
+                $order = intval( $order );
195 195
 
196
-				$url = ( $social_provider_option && array_key_exists( 'url', $social_provider_option ) ) ? $social_provider_option['url'] : $social_provider_default['url'];
197
-				$url = esc_attr( $url );
196
+                $url = ( $social_provider_option && array_key_exists( 'url', $social_provider_option ) ) ? $social_provider_option['url'] : $social_provider_default['url'];
197
+                $url = esc_attr( $url );
198 198
 
199
-				$profile_data = array(
200
-					'id'         => $id,
201
-					'class'      => $class,
202
-					'icon'       => $icon,
203
-					'enabled'    => $enabled,
204
-					'url'        => $url,
205
-					'color'      => $color,
206
-					'background' => $background,
207
-					'order'      => $order,
208
-					'name'       => $name,
209
-					'label'      => $label,
210
-				);
199
+                $profile_data = array(
200
+                    'id'         => $id,
201
+                    'class'      => $class,
202
+                    'icon'       => $icon,
203
+                    'enabled'    => $enabled,
204
+                    'url'        => $url,
205
+                    'color'      => $color,
206
+                    'background' => $background,
207
+                    'order'      => $order,
208
+                    'name'       => $name,
209
+                    'label'      => $label,
210
+                );
211 211
 
212
-				$profile_data = rawurlencode( wp_json_encode( $profile_data ) );
212
+                $profile_data = rawurlencode( wp_json_encode( $profile_data ) );
213 213
 
214
-				echo '<input
214
+                echo '<input
215 215
 	                    type="hidden"
216 216
 	                    class="redux-social-profiles-hidden-data-' . esc_attr( $key ) . '"
217 217
 	                    id="' . esc_attr( $this->field_id ) . '-' . esc_attr( $id ) . '-data"
218 218
 	                    name="' . esc_attr( $this->field['name'] ) . esc_attr( $this->field['name_suffix'] ) . '[' . esc_attr( $key ) . '][data]"
219 219
 	                    value="' . $profile_data . '" />'; // phpcs:ignore WordPress.Security.EscapeOutput
220 220
 
221
-				echo '<div class="redux-icon-preview">';
222
-				Redux_Social_Profiles_Functions::render_icon( $class, $icon, $color, $background, $name );
223
-				echo '&nbsp;</div>';
221
+                echo '<div class="redux-icon-preview">';
222
+                Redux_Social_Profiles_Functions::render_icon( $class, $icon, $color, $background, $name );
223
+                echo '&nbsp;</div>';
224 224
 
225
-				echo '<div class="redux-social-profiles-item-name">';
226
-				echo esc_html( $name );
227
-				echo '</div>';
225
+                echo '<div class="redux-social-profiles-item-name">';
226
+                echo esc_html( $name );
227
+                echo '</div>';
228 228
 
229
-				echo '<div class="redux-social-profiles-item-enabled">';
230
-				$checked = ( $enabled ) ? 'checked' : '';
231
-				echo '<input type="checkbox" id="' . esc_attr( $this->field['id'] ) . '-checkbox-' . esc_attr( $key ) . '" class="checkbox-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" value="1" ' . esc_attr( $checked ) . '/>';
232
-				esc_html_e( 'Enabled', 'redux-framework' );
233
-				echo '</div>';
229
+                echo '<div class="redux-social-profiles-item-enabled">';
230
+                $checked = ( $enabled ) ? 'checked' : '';
231
+                echo '<input type="checkbox" id="' . esc_attr( $this->field['id'] ) . '-checkbox-' . esc_attr( $key ) . '" class="checkbox-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" value="1" ' . esc_attr( $checked ) . '/>';
232
+                esc_html_e( 'Enabled', 'redux-framework' );
233
+                echo '</div>';
234 234
 
235
-				$color_class = $color_pickers ? '' : ' no-color-pickers';
235
+                $color_class = $color_pickers ? '' : ' no-color-pickers';
236 236
 
237
-				echo '<div class="redux-social-profiles-link-url input_wrapper' . esc_attr( $color_class ) . '">';
238
-				echo '<label for="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-text-url-label">' . esc_html( $label ) . '</label>';
239
-				echo '<input id="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-social-profiles-url-text" data-key="' . esc_attr( $key ) . '" type="text" value="' . esc_url( $url ) . '" />';
240
-				echo '</div>';
237
+                echo '<div class="redux-social-profiles-link-url input_wrapper' . esc_attr( $color_class ) . '">';
238
+                echo '<label for="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-text-url-label">' . esc_html( $label ) . '</label>';
239
+                echo '<input id="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-social-profiles-url-text" data-key="' . esc_attr( $key ) . '" type="text" value="' . esc_url( $url ) . '" />';
240
+                echo '</div>';
241 241
 
242
-				$reset_text = __( 'Reset', 'redux-framework' );
243
-				echo '<div class="redux-social-profiles-item-reset">';
244
-				echo '<a class="button" data-value="' . esc_attr( $key ) . '" value="' . esc_attr( $reset_text ) . '" />' . esc_html( $reset_text ) . '</a>';
245
-				echo '</div>';
242
+                $reset_text = __( 'Reset', 'redux-framework' );
243
+                echo '<div class="redux-social-profiles-item-reset">';
244
+                echo '<a class="button" data-value="' . esc_attr( $key ) . '" value="' . esc_attr( $reset_text ) . '" />' . esc_html( $reset_text ) . '</a>';
245
+                echo '</div>';
246 246
 
247
-				if ( $color_pickers ) {
248
-					// phpcs:ignore WordPress.NamingConventions.ValidHookName
249
-					$label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/text', esc_html__( 'Text', 'redux-framework' ) );
247
+                if ( $color_pickers ) {
248
+                    // phpcs:ignore WordPress.NamingConventions.ValidHookName
249
+                    $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/text', esc_html__( 'Text', 'redux-framework' ) );
250 250
 
251
-					echo '<div class="redux-social-profiles-text-color picker_wrapper" >';
252
-					echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" class="redux-text-color-label">' . esc_html( $label ) . '</label>';
253
-					echo '<input
251
+                    echo '<div class="redux-social-profiles-text-color picker_wrapper" >';
252
+                    echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" class="redux-text-color-label">' . esc_html( $label ) . '</label>';
253
+                    echo '<input
254 254
                             class="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text"
255 255
                             id="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text"
256 256
                             type="text"
257 257
                             value="' . esc_attr( $color ) . '"
258 258
                             data-key="' . esc_attr( $key ) . '"
259 259
                         />';
260
-					echo '</div>';
260
+                    echo '</div>';
261 261
 
262
-					// phpcs:ignore WordPress.NamingConventions.ValidHookName
263
-					$label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/background', esc_html__( 'Background', 'redux-framework' ) );
262
+                    // phpcs:ignore WordPress.NamingConventions.ValidHookName
263
+                    $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/background', esc_html__( 'Background', 'redux-framework' ) );
264 264
 
265
-					echo '<div class="redux-social-profiles-background-color picker_wrapper">';
266
-					echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" class="redux-background-color-label" for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background">' . esc_html( $label ) . '</label>';
267
-					echo '<input
265
+                    echo '<div class="redux-social-profiles-background-color picker_wrapper">';
266
+                    echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" class="redux-background-color-label" for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background">' . esc_html( $label ) . '</label>';
267
+                    echo '<input
268 268
                             class="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background"
269 269
                             id="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background"
270 270
                             type="text"
271 271
                             value="' . esc_attr( $background ) . '"
272 272
                             data-key="' . esc_attr( $key ) . '"
273 273
                         />';
274
-					echo '</div>';
275
-				}
274
+                    echo '</div>';
275
+                }
276 276
 
277
-				echo '<div class="redux-social-profiles-item-order">';
278
-				echo '<input
277
+                echo '<div class="redux-social-profiles-item-order">';
278
+                echo '<input
279 279
 				        id="' . esc_attr( $this->field['id'] ) . '-item-order-' . esc_attr( $key ) . '"
280 280
                         type="hidden"
281 281
                         value="' . esc_attr( $order ) . '"
282 282
                     />';
283
-				echo '</div>';
284
-
285
-				echo '</div>';
286
-				echo '</li>';
287
-			}
288
-
289
-			echo '</ul>';
290
-			echo '</div>';
291
-		}
292
-
293
-		/**
294
-		 * This function is unused, but necessary to trigger output.
295
-		 *
296
-		 * @param mixed $data CSS data.
297
-		 *
298
-		 * @return mixed|string|void
299
-		 */
300
-		public function css_style( $data ) {
301
-			return $data;
302
-		}
303
-
304
-		/**
305
-		 * Used to enqueue to the front-end
306
-		 *
307
-		 * @param string|null|array $style Style.
308
-		 */
309
-		public function output( $style = '' ) {
310
-			if ( ! empty( $this->value ) ) {
311
-				foreach ( $this->value as $arr ) {
312
-
313
-					// For customizer.
314
-					if ( isset( $arr['data'] ) ) {
315
-						$arr = rawurldecode( $arr['data'] );
316
-						$arr = (array) json_decode( $arr );
317
-					}
318
-
319
-					if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
320
-						Redux_Functions_Ex::enqueue_font_awesome();
321
-					}
322
-				}
323
-			}
324
-		}
325
-
326
-		/**
327
-		 * Enqueue Function.
328
-		 * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
329
-		 *
330
-		 * @since       1.0.0
331
-		 * @access      public
332
-		 * @return      void
333
-		 */
334
-		public function enqueue() {
335
-			if ( empty( $this->field ) ) {
336
-				return;
337
-			}
338
-
339
-			$min = Redux_Functions::isMin();
340
-
341
-			Redux_Functions_Ex::enqueue_font_awesome();
342
-
343
-			// Field dependent JS.
344
-			wp_enqueue_script(
345
-				'redux-field-social-profiles',
346
-				$this->url . 'redux-social-profiles' . $min . '.js',
347
-				array( 'jquery', 'jquery-ui-sortable', 'redux-spectrum-js', 'redux-js' ),
348
-				Redux_Extension_Social_Profiles::$version,
349
-				true
350
-			);
351
-
352
-			wp_localize_script(
353
-				'redux-field-social-profiles',
354
-				'reduxSocialDefaults',
355
-				$this->defaults
356
-			);
357
-
358
-			if ( $this->parent->args['dev_mode'] ) {
359
-				wp_enqueue_style(
360
-					'redux-field-social-profiles',
361
-					$this->url . 'redux-social-profiles.css',
362
-					array( 'redux-spectrum-css' ),
363
-					Redux_Extension_Social_Profiles::$version
364
-				);
365
-			}
366
-		}
367
-	}
283
+                echo '</div>';
284
+
285
+                echo '</div>';
286
+                echo '</li>';
287
+            }
288
+
289
+            echo '</ul>';
290
+            echo '</div>';
291
+        }
292
+
293
+        /**
294
+         * This function is unused, but necessary to trigger output.
295
+         *
296
+         * @param mixed $data CSS data.
297
+         *
298
+         * @return mixed|string|void
299
+         */
300
+        public function css_style( $data ) {
301
+            return $data;
302
+        }
303
+
304
+        /**
305
+         * Used to enqueue to the front-end
306
+         *
307
+         * @param string|null|array $style Style.
308
+         */
309
+        public function output( $style = '' ) {
310
+            if ( ! empty( $this->value ) ) {
311
+                foreach ( $this->value as $arr ) {
312
+
313
+                    // For customizer.
314
+                    if ( isset( $arr['data'] ) ) {
315
+                        $arr = rawurldecode( $arr['data'] );
316
+                        $arr = (array) json_decode( $arr );
317
+                    }
318
+
319
+                    if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
320
+                        Redux_Functions_Ex::enqueue_font_awesome();
321
+                    }
322
+                }
323
+            }
324
+        }
325
+
326
+        /**
327
+         * Enqueue Function.
328
+         * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
329
+         *
330
+         * @since       1.0.0
331
+         * @access      public
332
+         * @return      void
333
+         */
334
+        public function enqueue() {
335
+            if ( empty( $this->field ) ) {
336
+                return;
337
+            }
338
+
339
+            $min = Redux_Functions::isMin();
340
+
341
+            Redux_Functions_Ex::enqueue_font_awesome();
342
+
343
+            // Field dependent JS.
344
+            wp_enqueue_script(
345
+                'redux-field-social-profiles',
346
+                $this->url . 'redux-social-profiles' . $min . '.js',
347
+                array( 'jquery', 'jquery-ui-sortable', 'redux-spectrum-js', 'redux-js' ),
348
+                Redux_Extension_Social_Profiles::$version,
349
+                true
350
+            );
351
+
352
+            wp_localize_script(
353
+                'redux-field-social-profiles',
354
+                'reduxSocialDefaults',
355
+                $this->defaults
356
+            );
357
+
358
+            if ( $this->parent->args['dev_mode'] ) {
359
+                wp_enqueue_style(
360
+                    'redux-field-social-profiles',
361
+                    $this->url . 'redux-social-profiles.css',
362
+                    array( 'redux-spectrum-css' ),
363
+                    Redux_Extension_Social_Profiles::$version
364
+                );
365
+            }
366
+        }
367
+    }
368 368
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
 				foreach ( $settings as $a ) {
70 70
 					if ( isset( $a['data'] ) ) {
71 71
 						$a['data'] = rawurldecode( $a['data'] );
72
-						$a         = (array) json_decode( $a['data'] );
72
+						$a         = ( array ) json_decode( $a['data'] );
73 73
 					}
74 74
 
75 75
 					if ( $default_id === $a['id'] ) {
76 76
 						$search_default    = false;
77
-						$fixed_arr[ $key ] = $a;
77
+						$fixed_arr[$key] = $a;
78 78
 						break;
79 79
 					}
80 80
 				}
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 					foreach ( $stock as $def_arr ) {
89 89
 						if ( $default_id === $def_arr['id'] ) {
90
-							$fixed_arr[ $key ] = $def_arr;
90
+							$fixed_arr[$key] = $def_arr;
91 91
 							break;
92 92
 						}
93 93
 					}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			global $pagenow, $post;
114 114
 
115 115
 			$redux_settings = get_option( $this->opt_name );
116
-			$settings       = $redux_settings[ $this->field_id ] ?? array();
116
+			$settings       = $redux_settings[$this->field_id] ?? array();
117 117
 
118 118
 			if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) {
119 119
 				$post_settings = get_post_meta( $post->ID, $this->field_id, true );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			$settings = $this->rebuild_setttings( $settings );
152 152
 
153 153
 			foreach ( $this->defaults as $key => $social_provider_default ) {
154
-				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
154
+				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[$key] : null;
155 155
 
156 156
 				$icon    = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
157 157
 				$name    = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name'];
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 				echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">';
176 176
 				echo '<div class="redux-social-item-container">';
177 177
 
178
-				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null;
178
+				$social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[$key] : null;
179 179
 				$icon                   = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon'];
180 180
 				$id                     = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id'];
181 181
 				$class                  = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class'];
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 					// For customizer.
314 314
 					if ( isset( $arr['data'] ) ) {
315 315
 						$arr = rawurldecode( $arr['data'] );
316
-						$arr = (array) json_decode( $arr );
316
+						$arr = ( array ) json_decode( $arr );
317 317
 					}
318 318
 
319 319
 					if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
Please login to merge, or discard this patch.
sample/sections/extensions/icon-select.php 1 patch
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -16,82 +16,82 @@
 block discarded – undo
16 16
 require_once Redux_Core::$dir . 'inc/extensions/icon_select/font-awesome-5-free.php';
17 17
 
18 18
 Redux::set_section(
19
-	$opt_name,
20
-	array(
21
-		'title'      => esc_html__( 'Icon Select', 'your-textdomain-here' ),
22
-		'desc'       => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/icon-select.html" target="_blank">https://devs.redux.io/core-extensions/icon-select.html</a>',
23
-		'subsection' => true,
24
-		'fields'     => array(
19
+    $opt_name,
20
+    array(
21
+        'title'      => esc_html__( 'Icon Select', 'your-textdomain-here' ),
22
+        'desc'       => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/icon-select.html" target="_blank">https://devs.redux.io/core-extensions/icon-select.html</a>',
23
+        'subsection' => true,
24
+        'fields'     => array(
25 25
 
26
-			/**
27
-			 * This field was left in the sample config to display that every effort to maintain backward compatibility with older
28
-			 * versions of Icon Select has been implemented.
29
-			 * Please do NOT use argument in this field in your projects.
30
-			 * They are considered deprecated.
31
-			 */
32
-			array(
33
-				'id'               => 'icon-select-legacy',
34
-				'type'             => 'icon_select',
35
-				'title'            => esc_html__( 'Legacy Icon Select', 'your-textdomain-here' ),
36
-				'subtitle'         => esc_html__( 'Original Icon Select field that maintains backward compatibility with the original extension.', 'your-textdomain-here' ),
37
-				'default'          => '',
38
-				'options'          => redux_icon_select_fa_5_free(),
26
+            /**
27
+             * This field was left in the sample config to display that every effort to maintain backward compatibility with older
28
+             * versions of Icon Select has been implemented.
29
+             * Please do NOT use argument in this field in your projects.
30
+             * They are considered deprecated.
31
+             */
32
+            array(
33
+                'id'               => 'icon-select-legacy',
34
+                'type'             => 'icon_select',
35
+                'title'            => esc_html__( 'Legacy Icon Select', 'your-textdomain-here' ),
36
+                'subtitle'         => esc_html__( 'Original Icon Select field that maintains backward compatibility with the original extension.', 'your-textdomain-here' ),
37
+                'default'          => '',
38
+                'options'          => redux_icon_select_fa_5_free(),
39 39
 
40
-				// Disable auto-enqueue of stylesheet if present in the panel.
41
-				'enqueue'          => true,
40
+                // Disable auto-enqueue of stylesheet if present in the panel.
41
+                'enqueue'          => true,
42 42
 
43
-				// Disable auto-enqueue of stylesheet on the front-end.
44
-				'enqueue_frontend' => true,
43
+                // Disable auto-enqueue of stylesheet on the front-end.
44
+                'enqueue_frontend' => true,
45 45
 
46
-				// Stylesheet URL.
47
-				//'stylesheet'       => 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css',
46
+                // Stylesheet URL.
47
+                //'stylesheet'       => 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css',
48 48
 
49
-				// (Optional) Specify a class prefix if one is needed to initialize the icon.
50
-				'prefix'           => 'fa',
51
-			),
49
+                // (Optional) Specify a class prefix if one is needed to initialize the icon.
50
+                'prefix'           => 'fa',
51
+            ),
52 52
 
53
-			/**
54
-			 * When creating fields for Icon Select, use this as a template instead.
55
-			 * For detailed documentation, see: https://devs.redux.io/core-extensions/icon-select.html
56
-			 */
57
-			array(
58
-				'id'               => 'icon-select',
59
-				'type'             => 'icon_select',
60
-				'title'            => esc_html__( 'Icon Select', 'your-textdomain-here' ),
61
-				'subtitle'         => esc_html__( 'Select an icon.', 'your-textdomain-here' ),
62
-				'default'          => 'fas fa-1',
53
+            /**
54
+             * When creating fields for Icon Select, use this as a template instead.
55
+             * For detailed documentation, see: https://devs.redux.io/core-extensions/icon-select.html
56
+             */
57
+            array(
58
+                'id'               => 'icon-select',
59
+                'type'             => 'icon_select',
60
+                'title'            => esc_html__( 'Icon Select', 'your-textdomain-here' ),
61
+                'subtitle'         => esc_html__( 'Select an icon.', 'your-textdomain-here' ),
62
+                'default'          => 'fas fa-1',
63 63
 
64
-				// Disable auto-enqueue of stylesheet if present in the panel.
65
-				'enqueue'          => true,
64
+                // Disable auto-enqueue of stylesheet if present in the panel.
65
+                'enqueue'          => true,
66 66
 
67
-				// Disable auto-enqueue of stylesheet on the front-end.
68
-				'enqueue_frontend' => true,
67
+                // Disable auto-enqueue of stylesheet on the front-end.
68
+                'enqueue_frontend' => true,
69 69
 
70
-				// Stylesheet data.
71
-				'stylesheet'       => array(
72
-					array(
73
-						'url'    => 'https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/7.2.96/css/materialdesignicons.css',
74
-						'title'  => 'Material Icons',
75
-						'prefix' => 'mdi-set',
76
-					),
77
-					array(
78
-						'url'    => 'https://icons.getbootstrap.com/assets/font/bootstrap-icons.min.css',
79
-						'title'  => 'Bootstrap',
80
-						'prefix' => 'bi',
81
-					),
82
-					array(
83
-						'url'    => 'https://cdn.lineicons.com/4.0/lineicons.css',
84
-						'title'  => 'Line Icons',
85
-						'prefix' => 'lni',
86
-					),
87
-					array(
88
-						'url'    => 'https://cdn.jsdelivr.net/gh/devicons/[email protected]/devicon.min.css',
89
-						'title'  => 'Dev Icons',
90
-						'prefix' => '',
91
-					),
92
-				),
93
-			),
94
-		),
95
-	)
70
+                // Stylesheet data.
71
+                'stylesheet'       => array(
72
+                    array(
73
+                        'url'    => 'https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/7.2.96/css/materialdesignicons.css',
74
+                        'title'  => 'Material Icons',
75
+                        'prefix' => 'mdi-set',
76
+                    ),
77
+                    array(
78
+                        'url'    => 'https://icons.getbootstrap.com/assets/font/bootstrap-icons.min.css',
79
+                        'title'  => 'Bootstrap',
80
+                        'prefix' => 'bi',
81
+                    ),
82
+                    array(
83
+                        'url'    => 'https://cdn.lineicons.com/4.0/lineicons.css',
84
+                        'title'  => 'Line Icons',
85
+                        'prefix' => 'lni',
86
+                    ),
87
+                    array(
88
+                        'url'    => 'https://cdn.jsdelivr.net/gh/devicons/[email protected]/devicon.min.css',
89
+                        'title'  => 'Dev Icons',
90
+                        'prefix' => '',
91
+                    ),
92
+                ),
93
+            ),
94
+        ),
95
+    )
96 96
 );
97 97
 // phpcs:enable
Please login to merge, or discard this patch.
redux-core/inc/classes/class-redux-validation.php 2 patches
Indentation   +237 added lines, -237 removed lines patch added patch discarded remove patch
@@ -11,241 +11,241 @@
 block discarded – undo
11 11
 
12 12
 if ( ! class_exists( 'Redux_Validation', false ) ) {
13 13
 
14
-	/**
15
-	 * Class Redux_Validation
16
-	 */
17
-	class Redux_Validation extends Redux_Class {
18
-
19
-		/**
20
-		 * Validate values from options form (used in settings api validate function)
21
-		 * calls the custom validation class for the field so authors can override with custom classes
22
-		 *
23
-		 * @since       1.0.0
24
-		 * @access      public
25
-		 *
26
-		 * @param       array $plugin_options Plugin Options.
27
-		 * @param       array $options        Options.
28
-		 * @param       array $sections       Sections array.
29
-		 *
30
-		 * @return      array $plugin_options
31
-		 */
32
-		public function validate( array $plugin_options, array $options, array $sections ): array {
33
-			$core = $this->core();
34
-
35
-			if (null === $core) {
36
-				return $plugin_options;
37
-			}
38
-
39
-			foreach ( $sections as $k => $section ) {
40
-				if ( isset( $section['fields'] ) ) {
41
-					foreach ( $section['fields'] as $fkey => $field ) {
42
-						if ( is_array( $field ) ) {
43
-							$field['section_id'] = $k;
44
-						}
45
-
46
-						if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) {
47
-							if ( ! isset( $plugin_options[ $field['id'] ] ) ) {
48
-								$plugin_options[ $field['id'] ] = 0;
49
-							}
50
-						}
51
-
52
-						// Part of Dovy's serialize typography effort.  Preserved here in case it becomes a thing. - kp.
53
-						/**
54
-						 * If ( isset ( $field['type'] ) && $field['type'] == 'typography' ) {
55
-						 *      if ( ! is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) {
56
-						 *          $plugin_options[ $field['id'] ] = json_decode( $plugin_options[ $field['id'] ], true );
57
-						 *      }
58
-						 * }
59
-						 */
60
-
61
-						if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) {
62
-							$plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections );
63
-						}
64
-
65
-						// Make sure 'validate' field is set.
66
-						if ( isset( $field['validate'] ) ) {
67
-
68
-							// Can we make this an array of validations?
69
-							$val_arr = array();
70
-
71
-							if ( is_array( $field['validate'] ) ) {
72
-								$val_arr = $field['validate'];
73
-							} else {
74
-								$val_arr[] = $field['validate'];
75
-							}
76
-
77
-							foreach ( $val_arr as $idx => $val ) {
78
-								// shim for old *_not_empty validations.
79
-								if ( 'email_not_empty' === $val || 'numeric_not_empty' === $val ) {
80
-									$val = 'not_empty';
81
-								}
82
-
83
-								// Make sure 'validate field' is set to 'not_empty'.
84
-								$is_not_empty = false;
85
-
86
-								if ( 'not_empty' === $val ) {
87
-									// Set the flag.
88
-									$is_not_empty = true;
89
-								}
90
-
91
-								// Check for empty id value.
92
-								if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) {
93
-
94
-									// If we are looking for an empty value, in the case of 'not_empty'
95
-									// then we need to keep processing.
96
-									if ( ! $is_not_empty ) {
97
-
98
-										// Empty id and not checking for 'not_empty'.  Bail out...
99
-										if ( ! isset( $field['validate_callback'] ) ) {
100
-											continue;
101
-										}
102
-									}
103
-								}
104
-
105
-								// Force validate of custom field types.
106
-								if ( isset( $field['type'] ) && ! isset( $val ) && ! isset( $field['validate_callback'] ) ) {
107
-									if ( 'color' === $field['type'] || 'color_gradient' === $field['type'] ) {
108
-										$val = 'color';
109
-									} elseif ( 'date' === $field['type'] ) {
110
-										$val = 'date';
111
-									}
112
-								}
113
-
114
-								// No need.  Spectrum self validates.
115
-								if ( 'color_rgba' === $field['type'] ) {
116
-									continue;
117
-								}
118
-
119
-								// Shim out old color rgba validators.
120
-								if ( 'color_rgba' === $val || 'colorrgba' === $val ) {
121
-									$val = 'color';
122
-								}
123
-
124
-								$validate = 'Redux_Validation_' . $val;
125
-
126
-								if ( ! class_exists( $validate ) ) {
127
-									$file = str_replace( '_', '-', $val );
128
-
129
-									/**
130
-									 * Filter 'redux/validate/{opt_name}/class/{field.validate}'
131
-									 *
132
-									 * @param string $validate   validation class file path
133
-									 */
134
-
135
-									// phpcs:ignore WordPress.NamingConventions.ValidHookName
136
-									$class_file = apply_filters( "redux/validate/{$core->args['opt_name']}/class/$val", Redux_Core::$dir . "inc/validation/$val/class-redux-validation-$file.php", $validate );
137
-
138
-									if ( $class_file ) {
139
-										if ( file_exists( $class_file ) ) {
140
-											require_once $class_file;
141
-										}
142
-									}
143
-								}
144
-
145
-								if ( class_exists( $validate ) ) {
146
-									if ( empty( $options[ $field['id'] ] ) ) {
147
-										$options[ $field['id'] ] = '';
148
-									}
149
-
150
-									if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) {
151
-										foreach ( $plugin_options[ $field['id'] ] as $key => $value ) {
152
-											$before = null;
153
-											$after  = null;
154
-
155
-											if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
156
-												if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) {
157
-													$before = $plugin_options[ $field['id'] ][ $key ];
158
-												} else {
159
-													$before = trim( $plugin_options[ $field['id'] ][ $key ] );
160
-												}
161
-											}
162
-
163
-											if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
164
-												$after = $options[ $field['id'] ][ $key ];
165
-											}
166
-
167
-											$validation = new $validate( $core, $field, $before, $after );
168
-
169
-											if ( ! empty( $validation->value ) || '0' === $validation->value ) {
170
-												$plugin_options[ $field['id'] ][ $key ] = $validation->value;
171
-											} else {
172
-												unset( $plugin_options[ $field['id'] ][ $key ] );
173
-											}
174
-
175
-											if ( ! empty( $validation->error ) ) {
176
-												$core->errors[] = $validation->error;
177
-											}
178
-
179
-											if ( ! empty( $validation->warning ) ) {
180
-												$core->warnings[] = $validation->warning;
181
-											}
182
-
183
-											if ( ! empty( $validation->sanitize ) ) {
184
-												$core->sanitize[] = $validation->sanitize;
185
-											}
186
-										}
187
-									} else {
188
-										if ( isset( $plugin_options[ $field['id'] ] ) ) {
189
-											if ( is_array( $plugin_options[ $field['id'] ] ) ) {
190
-												$pofi = $plugin_options[ $field['id'] ];
191
-											} else {
192
-												$pofi = trim( $plugin_options[ $field['id'] ] );
193
-											}
194
-										} else {
195
-											$pofi = null;
196
-										}
197
-
198
-										$validation                     = new $validate( $core, $field, $pofi, $options[ $field['id'] ] );
199
-										$plugin_options[ $field['id'] ] = $validation->value;
200
-
201
-										if ( ! empty( $validation->error ) ) {
202
-											$core->errors[] = $validation->error;
203
-										}
204
-
205
-										if ( ! empty( $validation->warning ) ) {
206
-											$core->warnings[] = $validation->warning;
207
-										}
208
-
209
-										if ( ! empty( $validation->sanitize ) ) {
210
-											$core->sanitize[] = $validation->sanitize;
211
-										}
212
-									}
213
-
214
-									break;
215
-								}
216
-							}
217
-						}
218
-
219
-						if ( isset( $field['validate_callback'] ) && ( is_callable( $field['validate_callback'] ) || ( is_string( $field['validate_callback'] ) && function_exists( $field['validate_callback'] ) ) ) ) {
220
-							$callback = $field['validate_callback'];
221
-							unset( $field['validate_callback'] );
222
-
223
-							$plugin_option = $plugin_options[ $field['id'] ] ?? null;
224
-							$option        = $options[ $field['id'] ] ?? null;
225
-
226
-							if ( null !== $plugin_option ) {
227
-								$callbackvalues = call_user_func( $callback, $field, $plugin_option, $option );
228
-
229
-								$plugin_options[ $field['id'] ] = $callbackvalues['value'];
230
-
231
-								if ( isset( $callbackvalues['error'] ) ) {
232
-									$core->errors[] = $callbackvalues['error'];
233
-								}
234
-
235
-								if ( isset( $callbackvalues['warning'] ) ) {
236
-									$core->warnings[] = $callbackvalues['warning'];
237
-								}
238
-
239
-								if ( isset( $callbackvalues['sanitize'] ) ) {
240
-									$core->sanitize[] = $callbackvalues['sanitize'];
241
-								}
242
-							}
243
-						}
244
-					}
245
-				}
246
-			}
247
-
248
-			return $plugin_options;
249
-		}
250
-	}
14
+    /**
15
+     * Class Redux_Validation
16
+     */
17
+    class Redux_Validation extends Redux_Class {
18
+
19
+        /**
20
+         * Validate values from options form (used in settings api validate function)
21
+         * calls the custom validation class for the field so authors can override with custom classes
22
+         *
23
+         * @since       1.0.0
24
+         * @access      public
25
+         *
26
+         * @param       array $plugin_options Plugin Options.
27
+         * @param       array $options        Options.
28
+         * @param       array $sections       Sections array.
29
+         *
30
+         * @return      array $plugin_options
31
+         */
32
+        public function validate( array $plugin_options, array $options, array $sections ): array {
33
+            $core = $this->core();
34
+
35
+            if (null === $core) {
36
+                return $plugin_options;
37
+            }
38
+
39
+            foreach ( $sections as $k => $section ) {
40
+                if ( isset( $section['fields'] ) ) {
41
+                    foreach ( $section['fields'] as $fkey => $field ) {
42
+                        if ( is_array( $field ) ) {
43
+                            $field['section_id'] = $k;
44
+                        }
45
+
46
+                        if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) {
47
+                            if ( ! isset( $plugin_options[ $field['id'] ] ) ) {
48
+                                $plugin_options[ $field['id'] ] = 0;
49
+                            }
50
+                        }
51
+
52
+                        // Part of Dovy's serialize typography effort.  Preserved here in case it becomes a thing. - kp.
53
+                        /**
54
+                         * If ( isset ( $field['type'] ) && $field['type'] == 'typography' ) {
55
+                         *      if ( ! is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) {
56
+                         *          $plugin_options[ $field['id'] ] = json_decode( $plugin_options[ $field['id'] ], true );
57
+                         *      }
58
+                         * }
59
+                         */
60
+
61
+                        if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) {
62
+                            $plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections );
63
+                        }
64
+
65
+                        // Make sure 'validate' field is set.
66
+                        if ( isset( $field['validate'] ) ) {
67
+
68
+                            // Can we make this an array of validations?
69
+                            $val_arr = array();
70
+
71
+                            if ( is_array( $field['validate'] ) ) {
72
+                                $val_arr = $field['validate'];
73
+                            } else {
74
+                                $val_arr[] = $field['validate'];
75
+                            }
76
+
77
+                            foreach ( $val_arr as $idx => $val ) {
78
+                                // shim for old *_not_empty validations.
79
+                                if ( 'email_not_empty' === $val || 'numeric_not_empty' === $val ) {
80
+                                    $val = 'not_empty';
81
+                                }
82
+
83
+                                // Make sure 'validate field' is set to 'not_empty'.
84
+                                $is_not_empty = false;
85
+
86
+                                if ( 'not_empty' === $val ) {
87
+                                    // Set the flag.
88
+                                    $is_not_empty = true;
89
+                                }
90
+
91
+                                // Check for empty id value.
92
+                                if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) {
93
+
94
+                                    // If we are looking for an empty value, in the case of 'not_empty'
95
+                                    // then we need to keep processing.
96
+                                    if ( ! $is_not_empty ) {
97
+
98
+                                        // Empty id and not checking for 'not_empty'.  Bail out...
99
+                                        if ( ! isset( $field['validate_callback'] ) ) {
100
+                                            continue;
101
+                                        }
102
+                                    }
103
+                                }
104
+
105
+                                // Force validate of custom field types.
106
+                                if ( isset( $field['type'] ) && ! isset( $val ) && ! isset( $field['validate_callback'] ) ) {
107
+                                    if ( 'color' === $field['type'] || 'color_gradient' === $field['type'] ) {
108
+                                        $val = 'color';
109
+                                    } elseif ( 'date' === $field['type'] ) {
110
+                                        $val = 'date';
111
+                                    }
112
+                                }
113
+
114
+                                // No need.  Spectrum self validates.
115
+                                if ( 'color_rgba' === $field['type'] ) {
116
+                                    continue;
117
+                                }
118
+
119
+                                // Shim out old color rgba validators.
120
+                                if ( 'color_rgba' === $val || 'colorrgba' === $val ) {
121
+                                    $val = 'color';
122
+                                }
123
+
124
+                                $validate = 'Redux_Validation_' . $val;
125
+
126
+                                if ( ! class_exists( $validate ) ) {
127
+                                    $file = str_replace( '_', '-', $val );
128
+
129
+                                    /**
130
+                                     * Filter 'redux/validate/{opt_name}/class/{field.validate}'
131
+                                     *
132
+                                     * @param string $validate   validation class file path
133
+                                     */
134
+
135
+                                    // phpcs:ignore WordPress.NamingConventions.ValidHookName
136
+                                    $class_file = apply_filters( "redux/validate/{$core->args['opt_name']}/class/$val", Redux_Core::$dir . "inc/validation/$val/class-redux-validation-$file.php", $validate );
137
+
138
+                                    if ( $class_file ) {
139
+                                        if ( file_exists( $class_file ) ) {
140
+                                            require_once $class_file;
141
+                                        }
142
+                                    }
143
+                                }
144
+
145
+                                if ( class_exists( $validate ) ) {
146
+                                    if ( empty( $options[ $field['id'] ] ) ) {
147
+                                        $options[ $field['id'] ] = '';
148
+                                    }
149
+
150
+                                    if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) {
151
+                                        foreach ( $plugin_options[ $field['id'] ] as $key => $value ) {
152
+                                            $before = null;
153
+                                            $after  = null;
154
+
155
+                                            if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
156
+                                                if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) {
157
+                                                    $before = $plugin_options[ $field['id'] ][ $key ];
158
+                                                } else {
159
+                                                    $before = trim( $plugin_options[ $field['id'] ][ $key ] );
160
+                                                }
161
+                                            }
162
+
163
+                                            if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
164
+                                                $after = $options[ $field['id'] ][ $key ];
165
+                                            }
166
+
167
+                                            $validation = new $validate( $core, $field, $before, $after );
168
+
169
+                                            if ( ! empty( $validation->value ) || '0' === $validation->value ) {
170
+                                                $plugin_options[ $field['id'] ][ $key ] = $validation->value;
171
+                                            } else {
172
+                                                unset( $plugin_options[ $field['id'] ][ $key ] );
173
+                                            }
174
+
175
+                                            if ( ! empty( $validation->error ) ) {
176
+                                                $core->errors[] = $validation->error;
177
+                                            }
178
+
179
+                                            if ( ! empty( $validation->warning ) ) {
180
+                                                $core->warnings[] = $validation->warning;
181
+                                            }
182
+
183
+                                            if ( ! empty( $validation->sanitize ) ) {
184
+                                                $core->sanitize[] = $validation->sanitize;
185
+                                            }
186
+                                        }
187
+                                    } else {
188
+                                        if ( isset( $plugin_options[ $field['id'] ] ) ) {
189
+                                            if ( is_array( $plugin_options[ $field['id'] ] ) ) {
190
+                                                $pofi = $plugin_options[ $field['id'] ];
191
+                                            } else {
192
+                                                $pofi = trim( $plugin_options[ $field['id'] ] );
193
+                                            }
194
+                                        } else {
195
+                                            $pofi = null;
196
+                                        }
197
+
198
+                                        $validation                     = new $validate( $core, $field, $pofi, $options[ $field['id'] ] );
199
+                                        $plugin_options[ $field['id'] ] = $validation->value;
200
+
201
+                                        if ( ! empty( $validation->error ) ) {
202
+                                            $core->errors[] = $validation->error;
203
+                                        }
204
+
205
+                                        if ( ! empty( $validation->warning ) ) {
206
+                                            $core->warnings[] = $validation->warning;
207
+                                        }
208
+
209
+                                        if ( ! empty( $validation->sanitize ) ) {
210
+                                            $core->sanitize[] = $validation->sanitize;
211
+                                        }
212
+                                    }
213
+
214
+                                    break;
215
+                                }
216
+                            }
217
+                        }
218
+
219
+                        if ( isset( $field['validate_callback'] ) && ( is_callable( $field['validate_callback'] ) || ( is_string( $field['validate_callback'] ) && function_exists( $field['validate_callback'] ) ) ) ) {
220
+                            $callback = $field['validate_callback'];
221
+                            unset( $field['validate_callback'] );
222
+
223
+                            $plugin_option = $plugin_options[ $field['id'] ] ?? null;
224
+                            $option        = $options[ $field['id'] ] ?? null;
225
+
226
+                            if ( null !== $plugin_option ) {
227
+                                $callbackvalues = call_user_func( $callback, $field, $plugin_option, $option );
228
+
229
+                                $plugin_options[ $field['id'] ] = $callbackvalues['value'];
230
+
231
+                                if ( isset( $callbackvalues['error'] ) ) {
232
+                                    $core->errors[] = $callbackvalues['error'];
233
+                                }
234
+
235
+                                if ( isset( $callbackvalues['warning'] ) ) {
236
+                                    $core->warnings[] = $callbackvalues['warning'];
237
+                                }
238
+
239
+                                if ( isset( $callbackvalues['sanitize'] ) ) {
240
+                                    $core->sanitize[] = $callbackvalues['sanitize'];
241
+                                }
242
+                            }
243
+                        }
244
+                    }
245
+                }
246
+            }
247
+
248
+            return $plugin_options;
249
+        }
250
+    }
251 251
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		public function validate( array $plugin_options, array $options, array $sections ): array {
33 33
 			$core = $this->core();
34 34
 
35
-			if (null === $core) {
35
+			if ( null === $core ) {
36 36
 				return $plugin_options;
37 37
 			}
38 38
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 						}
45 45
 
46 46
 						if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) {
47
-							if ( ! isset( $plugin_options[ $field['id'] ] ) ) {
48
-								$plugin_options[ $field['id'] ] = 0;
47
+							if ( ! isset( $plugin_options[$field['id']] ) ) {
48
+								$plugin_options[$field['id']] = 0;
49 49
 							}
50 50
 						}
51 51
 
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 						 * }
59 59
 						 */
60 60
 
61
-						if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) {
62
-							$plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections );
61
+						if ( isset( $core->extensions[$field['type']] ) && method_exists( $core->extensions[$field['type']], '_validate_values' ) ) {
62
+							$plugin_options = $core->extensions[$field['type']]->_validate_values( $plugin_options, $field, $sections );
63 63
 						}
64 64
 
65 65
 						// Make sure 'validate' field is set.
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 								}
90 90
 
91 91
 								// Check for empty id value.
92
-								if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) {
92
+								if ( ! isset( $field['id'] ) || ! isset( $plugin_options[$field['id']] ) || ( '' === $plugin_options[$field['id']] ) ) {
93 93
 
94 94
 									// If we are looking for an empty value, in the case of 'not_empty'
95 95
 									// then we need to keep processing.
@@ -143,33 +143,33 @@  discard block
 block discarded – undo
143 143
 								}
144 144
 
145 145
 								if ( class_exists( $validate ) ) {
146
-									if ( empty( $options[ $field['id'] ] ) ) {
147
-										$options[ $field['id'] ] = '';
146
+									if ( empty( $options[$field['id']] ) ) {
147
+										$options[$field['id']] = '';
148 148
 									}
149 149
 
150
-									if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) {
151
-										foreach ( $plugin_options[ $field['id'] ] as $key => $value ) {
150
+									if ( isset( $plugin_options[$field['id']] ) && is_array( $plugin_options[$field['id']] ) && ! empty( $plugin_options[$field['id']] ) ) {
151
+										foreach ( $plugin_options[$field['id']] as $key => $value ) {
152 152
 											$before = null;
153 153
 											$after  = null;
154 154
 
155
-											if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
156
-												if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) {
157
-													$before = $plugin_options[ $field['id'] ][ $key ];
155
+											if ( isset( $plugin_options[$field['id']][$key] ) && ( ! empty( $plugin_options[$field['id']][$key] ) || '0' === $plugin_options[$field['id']][$key] ) ) {
156
+												if ( is_array( $plugin_options[$field['id']][$key] ) ) {
157
+													$before = $plugin_options[$field['id']][$key];
158 158
 												} else {
159
-													$before = trim( $plugin_options[ $field['id'] ][ $key ] );
159
+													$before = trim( $plugin_options[$field['id']][$key] );
160 160
 												}
161 161
 											}
162 162
 
163
-											if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) {
164
-												$after = $options[ $field['id'] ][ $key ];
163
+											if ( isset( $options[$field['id']][$key] ) && ( ! empty( $plugin_options[$field['id']][$key] ) || '0' === $plugin_options[$field['id']][$key] ) ) {
164
+												$after = $options[$field['id']][$key];
165 165
 											}
166 166
 
167 167
 											$validation = new $validate( $core, $field, $before, $after );
168 168
 
169 169
 											if ( ! empty( $validation->value ) || '0' === $validation->value ) {
170
-												$plugin_options[ $field['id'] ][ $key ] = $validation->value;
170
+												$plugin_options[$field['id']][$key] = $validation->value;
171 171
 											} else {
172
-												unset( $plugin_options[ $field['id'] ][ $key ] );
172
+												unset( $plugin_options[$field['id']][$key] );
173 173
 											}
174 174
 
175 175
 											if ( ! empty( $validation->error ) ) {
@@ -185,18 +185,18 @@  discard block
 block discarded – undo
185 185
 											}
186 186
 										}
187 187
 									} else {
188
-										if ( isset( $plugin_options[ $field['id'] ] ) ) {
189
-											if ( is_array( $plugin_options[ $field['id'] ] ) ) {
190
-												$pofi = $plugin_options[ $field['id'] ];
188
+										if ( isset( $plugin_options[$field['id']] ) ) {
189
+											if ( is_array( $plugin_options[$field['id']] ) ) {
190
+												$pofi = $plugin_options[$field['id']];
191 191
 											} else {
192
-												$pofi = trim( $plugin_options[ $field['id'] ] );
192
+												$pofi = trim( $plugin_options[$field['id']] );
193 193
 											}
194 194
 										} else {
195 195
 											$pofi = null;
196 196
 										}
197 197
 
198
-										$validation                     = new $validate( $core, $field, $pofi, $options[ $field['id'] ] );
199
-										$plugin_options[ $field['id'] ] = $validation->value;
198
+										$validation                     = new $validate( $core, $field, $pofi, $options[$field['id']] );
199
+										$plugin_options[$field['id']] = $validation->value;
200 200
 
201 201
 										if ( ! empty( $validation->error ) ) {
202 202
 											$core->errors[] = $validation->error;
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
 							$callback = $field['validate_callback'];
221 221
 							unset( $field['validate_callback'] );
222 222
 
223
-							$plugin_option = $plugin_options[ $field['id'] ] ?? null;
224
-							$option        = $options[ $field['id'] ] ?? null;
223
+							$plugin_option = $plugin_options[$field['id']] ?? null;
224
+							$option        = $options[$field['id']] ?? null;
225 225
 
226 226
 							if ( null !== $plugin_option ) {
227 227
 								$callbackvalues = call_user_func( $callback, $field, $plugin_option, $option );
228 228
 
229
-								$plugin_options[ $field['id'] ] = $callbackvalues['value'];
229
+								$plugin_options[$field['id']] = $callbackvalues['value'];
230 230
 
231 231
 								if ( isset( $callbackvalues['error'] ) ) {
232 232
 									$core->errors[] = $callbackvalues['error'];
Please login to merge, or discard this patch.