Version Description
- 2022-09-26 fix - jQuery UI tabs missing issue fixed.
Download this release
Release Info
Developer | pickplugins |
Plugin | Woocommerce Products Slider |
Version | 1.13.38 |
Comparing to | |
See all releases |
Code changes from version 1.13.37 to 1.13.38
- includes/class-settings-tabs.php +1189 -1193
- readme.txt +6 -2
- woocommerce-products-slider.php +2 -2
includes/class-settings-tabs.php
CHANGED
@@ -1,278 +1,282 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
|
4 |
-
if(
|
5 |
-
class settings_tabs_field
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
-
// $this->asset_dir_url = isset($args['asset_dir_url']) ? $args['asset_dir_url'] : '';
|
13 |
-
// $this->textdomain = isset($args['textdomain']) ? $args['textdomain'] : '';
|
14 |
|
15 |
-
|
16 |
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
42 |
-
|
|
|
43 |
}
|
44 |
|
|
|
|
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
$id = isset( $option['id'] ) ? $option['id'] : "";
|
51 |
-
$wraper_class = isset( $option['wraper_class'] ) ? $option['wraper_class'] : "";
|
52 |
-
$conditions = isset( $option['conditions'] ) ? $option['conditions'] : array();
|
53 |
|
54 |
-
|
55 |
-
|
56 |
|
57 |
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
endif;
|
117 |
-
if(!empty($cond_value)):
|
118 |
-
$depends .= ",'value':";
|
119 |
-
if(is_array($cond_value)):
|
120 |
-
$count= count($cond_value);
|
121 |
-
$i = 1;
|
122 |
-
$depends .= "[";
|
123 |
-
foreach ($cond_value as $val):
|
124 |
-
$depends .= "'".$val."'";
|
125 |
-
if($i<$count)
|
126 |
-
$depends .= ",";
|
127 |
-
$i++;
|
128 |
-
endforeach;
|
129 |
-
$depends .= "]";
|
130 |
-
else:
|
131 |
-
$depends .= "[";
|
132 |
-
$depends .= "'".$cond_value."'";
|
133 |
-
$depends .= "]";
|
134 |
endif;
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
-
|
139 |
|
140 |
|
141 |
|
142 |
-
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
|
|
153 |
</div>
|
154 |
-
</div>
|
155 |
<?php
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
}
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
-
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
|
210 |
|
211 |
|
212 |
-
|
213 |
|
214 |
|
215 |
-
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
-
|
222 |
|
223 |
|
224 |
-
|
|
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
|
234 |
-
|
235 |
|
236 |
-
|
237 |
|
238 |
-
|
239 |
|
240 |
-
|
241 |
-
|
242 |
|
243 |
|
244 |
-
|
245 |
-
|
246 |
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
|
251 |
|
252 |
-
|
253 |
?>
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
|
258 |
-
|
259 |
-
|
260 |
|
261 |
-
|
262 |
|
263 |
-
|
264 |
-
|
265 |
|
266 |
|
267 |
-
|
268 |
-
|
269 |
|
270 |
-
|
271 |
<div class="group">
|
272 |
<h3 class="accordion-title">
|
273 |
|
274 |
|
275 |
-
<?php if($sortable): ?>
|
276 |
<span class="sort"><i class="fas fa-sort"></i></span>
|
277 |
<?php endif; ?>
|
278 |
|
@@ -282,38 +286,38 @@ class settings_tabs_field{
|
|
282 |
|
283 |
<?php
|
284 |
|
285 |
-
if(!empty($options)):
|
286 |
-
foreach ($options as $option):
|
287 |
-
|
288 |
-
$id
|
289 |
-
$type
|
290 |
-
$details
|
291 |
-
|
292 |
-
if(
|
293 |
-
elseif(
|
294 |
-
elseif(
|
295 |
-
elseif(
|
296 |
-
elseif(
|
297 |
-
elseif(
|
298 |
-
elseif(
|
299 |
-
elseif(
|
300 |
-
elseif(
|
301 |
-
elseif(
|
302 |
-
elseif(
|
303 |
-
elseif(
|
304 |
-
elseif(
|
305 |
-
|
306 |
-
elseif(
|
307 |
-
elseif(
|
308 |
-
elseif(
|
309 |
-
|
310 |
-
elseif(
|
311 |
-
elseif(
|
312 |
-
elseif(
|
313 |
-
elseif(
|
314 |
-
elseif(
|
315 |
-
elseif(
|
316 |
-
elseif(
|
317 |
|
318 |
endforeach;
|
319 |
endif;
|
@@ -323,438 +327,433 @@ class settings_tabs_field{
|
|
323 |
|
324 |
|
325 |
<?php
|
326 |
-
|
327 |
|
328 |
-
|
329 |
|
330 |
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
|
335 |
<?php
|
336 |
|
337 |
-
|
338 |
-
|
339 |
-
echo sprintf($field_template, $title, $input_html, $group_details);
|
340 |
-
|
341 |
|
342 |
-
|
|
|
343 |
|
344 |
|
345 |
-
|
|
|
346 |
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
|
352 |
-
|
353 |
-
|
354 |
|
355 |
|
356 |
-
|
357 |
-
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
|
363 |
|
364 |
-
|
365 |
?>
|
366 |
-
|
367 |
-
|
368 |
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
<?php
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
echo sprintf($field_template, $title, $input_html, $group_details);
|
411 |
-
|
412 |
|
413 |
-
|
|
|
414 |
|
415 |
|
416 |
-
|
|
|
417 |
|
418 |
|
419 |
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
|
429 |
-
|
430 |
|
431 |
-
|
432 |
-
|
433 |
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
|
442 |
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
|
447 |
-
|
448 |
-
|
449 |
|
450 |
|
451 |
|
452 |
-
|
453 |
-
|
454 |
|
455 |
?>
|
456 |
-
|
457 |
field-media-wrapper-<?php echo $css_id; ?>">
|
458 |
-
|
459 |
-
|
460 |
|
461 |
-
|
462 |
|
463 |
-
|
464 |
?>
|
465 |
-
|
466 |
-
|
467 |
<?php
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
|
|
479 |
?>
|
480 |
-
|
481 |
-
|
482 |
<?php
|
483 |
-
|
484 |
?>
|
485 |
-
|
486 |
-
|
487 |
|
488 |
<?php
|
489 |
-
|
490 |
-
|
|
|
|
|
|
|
|
|
|
|
491 |
</div>
|
492 |
-
<input class="media-input-value" type="hidden" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
493 |
-
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
|
494 |
-
<div placeholder="<?php echo $placeholder; ?>" class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear', $this->textdomain);?></div>
|
495 |
-
<div class="error-mgs"></div>
|
496 |
-
</div>
|
497 |
|
498 |
<?php
|
499 |
|
500 |
|
501 |
-
|
502 |
|
503 |
-
|
504 |
-
|
505 |
-
}
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
-
|
|
|
511 |
|
512 |
|
513 |
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
|
526 |
-
|
527 |
-
|
528 |
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
|
539 |
-
|
540 |
-
|
541 |
|
542 |
|
543 |
-
|
544 |
-
|
545 |
|
546 |
|
547 |
?>
|
548 |
-
|
549 |
field-media-wrapper-<?php echo $css_id; ?>">
|
550 |
-
|
551 |
-
|
552 |
|
553 |
-
|
554 |
?>
|
555 |
-
|
556 |
|
557 |
<?php
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
|
|
562 |
?>
|
563 |
-
|
564 |
|
565 |
<?php
|
566 |
-
|
567 |
-
|
568 |
-
else {
|
569 |
?>
|
570 |
-
|
571 |
|
572 |
<?php
|
573 |
-
|
574 |
-
|
|
|
|
|
|
|
|
|
|
|
575 |
</div>
|
576 |
-
<input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
577 |
-
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
|
578 |
-
<div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear','post-grid');?></div>
|
579 |
-
<div class="error-mgs"></div>
|
580 |
-
</div>
|
581 |
|
582 |
<?php
|
583 |
|
584 |
|
585 |
-
|
586 |
-
|
587 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
588 |
|
589 |
-
|
|
|
590 |
|
591 |
|
592 |
|
593 |
-
|
|
|
594 |
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
|
611 |
-
|
612 |
-
|
613 |
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
|
618 |
-
|
619 |
|
620 |
|
621 |
-
|
622 |
?>
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
|
|
|
|
|
|
|
|
628 |
?>
|
629 |
-
<span class="
|
|
|
630 |
<?php
|
631 |
-
endif;
|
632 |
-
?>
|
633 |
-
<span class="title-text">#TIMEINDEX</span>
|
634 |
-
</div>
|
635 |
-
<?php
|
636 |
|
637 |
|
638 |
-
|
639 |
-
|
640 |
|
641 |
-
|
642 |
-
|
643 |
|
644 |
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
<?php endif; ?>
|
650 |
|
651 |
-
<?php
|
652 |
-
$settings_tabs_field->generate_field($field);
|
653 |
-
?>
|
654 |
-
<?php if($collapsible):?>
|
655 |
</div>
|
656 |
-
<?php endif; ?>
|
657 |
-
|
658 |
-
</div>
|
659 |
<?php
|
660 |
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
|
667 |
-
|
668 |
|
669 |
-
|
670 |
-
|
671 |
|
672 |
|
673 |
-
|
674 |
-
|
675 |
|
676 |
|
677 |
-
|
678 |
field-repeatable-wrapper-<?php echo $css_id; ?>">
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
|
687 |
-
|
688 |
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
|
|
|
|
|
|
|
|
|
|
697 |
<?php endif; ?>
|
698 |
-
|
699 |
-
<span class="title-text"><?php echo $title_field_val; ?></span>
|
700 |
-
<?php if($collapsible):?>
|
701 |
-
</div>
|
702 |
-
<?php endif; ?>
|
703 |
-
<?php
|
704 |
|
705 |
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
|
711 |
-
|
712 |
|
713 |
-
|
714 |
?>
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
|
724 |
-
|
725 |
|
726 |
-
|
727 |
|
728 |
|
729 |
-
|
|
|
|
|
730 |
</div>
|
731 |
-
<?php
|
732 |
-
</div>
|
733 |
-
<?php
|
734 |
|
735 |
-
|
736 |
-
|
737 |
<?php
|
738 |
-
|
739 |
-
|
740 |
-
|
|
|
|
|
|
|
741 |
?>
|
742 |
-
|
743 |
-
|
744 |
-
?>
|
745 |
</div>
|
746 |
-
<div class="error-mgs"></div>
|
747 |
-
</div>
|
748 |
|
749 |
<?php
|
750 |
|
751 |
-
|
752 |
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
}
|
758 |
|
759 |
|
760 |
|
@@ -763,1071 +762,1068 @@ class settings_tabs_field{
|
|
763 |
|
764 |
|
765 |
|
766 |
-
|
|
|
767 |
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
|
776 |
-
|
777 |
-
|
778 |
|
779 |
|
780 |
-
|
781 |
-
|
782 |
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
|
787 |
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
|
798 |
|
799 |
-
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
-
|
805 |
?>
|
806 |
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
|
816 |
|
817 |
?>
|
818 |
-
|
|
|
|
|
|
|
|
|
819 |
<?php
|
820 |
-
|
821 |
?>
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
?>
|
826 |
-
<div class="button select-reset">Reset</div><br>
|
827 |
-
<?php
|
828 |
-
endif;
|
829 |
-
?>
|
830 |
|
831 |
<?php
|
832 |
|
833 |
-
|
834 |
-
|
835 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
836 |
-
|
837 |
|
838 |
-
|
|
|
839 |
|
840 |
-
|
|
|
841 |
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
|
850 |
-
|
851 |
-
|
852 |
|
853 |
|
854 |
-
|
855 |
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
|
866 |
-
|
867 |
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
|
872 |
-
|
873 |
|
874 |
-
|
875 |
|
876 |
-
|
877 |
|
878 |
-
|
879 |
|
880 |
|
881 |
-
|
882 |
?>
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
|
893 |
?>
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
<?php
|
900 |
|
901 |
-
|
902 |
|
903 |
-
|
|
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
-
|
|
|
910 |
|
|
|
|
|
|
|
|
|
911 |
|
|
|
|
|
912 |
|
|
|
913 |
|
|
|
|
|
|
|
914 |
|
915 |
-
public function field_text_multi( $option ){
|
916 |
|
917 |
-
|
918 |
-
|
919 |
-
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
920 |
-
$placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
|
921 |
|
922 |
-
$default = isset( $option['default'] ) ? $option['default'] : array();
|
923 |
-
$values = isset( $option['value'] ) ? $option['value'] : $default;
|
924 |
|
925 |
-
|
|
|
926 |
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
|
|
|
931 |
|
932 |
-
$is_pro = isset( $option['is_pro'] ) ? $option['is_pro'] : false;
|
933 |
-
$pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
|
934 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
|
936 |
-
$title = isset( $option['title'] ) ? $option['title'] : "";
|
937 |
-
$details = isset( $option['details'] ) ? $option['details'] : "";
|
938 |
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
|
943 |
-
|
|
|
|
|
|
|
944 |
|
|
|
945 |
|
946 |
-
ob_start();
|
947 |
-
?>
|
948 |
-
<div id="input-wrapper-<?php echo $id; ?>" class="input-wrapper input-text-multi-wrapper
|
949 |
-
input-text-multi-wrapper-<?php echo $css_id; ?>">
|
950 |
-
<span data-placeholder="<?php echo esc_attr($placeholder); ?>" data-sort="<?php echo $sortable; ?>" data-clone="<?php echo $allow_clone; ?>" data-name="<?php echo $field_name; ?>[]" class="button add-item"><?php echo __('Add', $this->textdomain); ?></span>
|
951 |
-
<div class="field-list <?php if($sortable){ echo 'sortable'; }?>" id="<?php echo $css_id; ?>">
|
952 |
-
<?php
|
953 |
-
if(!empty($values)):
|
954 |
-
foreach ($values as $value):
|
955 |
?>
|
956 |
<div class="item">
|
957 |
-
<input type="text" name="<?php echo esc_attr($field_name); ?>[]"
|
958 |
-
|
959 |
|
960 |
-
<?php if($allow_clone)
|
961 |
<span class="button clone"><i class="far fa-clone"></i></span>
|
962 |
<?php endif; ?>
|
963 |
|
964 |
|
965 |
-
<?php if($sortable)
|
966 |
<span class="button sort"><i class="fas fa-arrows-alt"></i></span>
|
967 |
<?php endif; ?>
|
968 |
|
969 |
<span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
|
970 |
</div>
|
971 |
<?php
|
972 |
-
endforeach;
|
973 |
-
|
974 |
-
else:
|
975 |
|
|
|
976 |
?>
|
977 |
-
|
978 |
-
|
979 |
-
echo esc_attr($placeholder); ?>" value="" />
|
980 |
-
|
981 |
-
<?php if($allow_clone):?>
|
982 |
-
<span class="button clone"><i class="far fa-clone"></i></span>
|
983 |
-
<?php endif; ?>
|
984 |
-
|
985 |
-
|
986 |
-
<?php if($sortable):?>
|
987 |
-
<span class="button sort"><i class="fas fa-arrows-alt"></i></span>
|
988 |
-
<?php endif; ?>
|
989 |
|
990 |
-
<span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
|
991 |
-
</div>
|
992 |
-
<?php
|
993 |
|
994 |
-
endif;
|
995 |
-
?>
|
996 |
</div>
|
997 |
-
<div class="error-mgs"></div>
|
998 |
-
|
999 |
-
|
1000 |
-
</div>
|
1001 |
|
1002 |
<?php
|
1003 |
|
1004 |
-
|
1005 |
-
|
1006 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1007 |
|
1008 |
-
|
|
|
1009 |
|
1010 |
-
|
|
|
1011 |
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
|
1020 |
-
|
1021 |
-
|
1022 |
|
1023 |
-
|
1024 |
|
1025 |
-
|
1026 |
-
|
1027 |
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
|
1032 |
-
|
1033 |
|
1034 |
|
1035 |
-
|
1036 |
?>
|
1037 |
-
|
1038 |
<?php
|
1039 |
|
1040 |
-
|
1041 |
-
|
1042 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1043 |
|
1044 |
-
|
|
|
1045 |
|
1046 |
|
1047 |
-
|
|
|
1048 |
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
|
1057 |
-
|
1058 |
-
|
1059 |
|
1060 |
-
|
1061 |
|
1062 |
-
|
1063 |
-
|
1064 |
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
|
1069 |
-
|
1070 |
|
1071 |
|
1072 |
-
|
1073 |
?>
|
1074 |
-
|
1075 |
<?php
|
1076 |
|
1077 |
-
|
1078 |
|
1079 |
-
|
1080 |
-
|
1081 |
-
}
|
1082 |
|
1083 |
|
1084 |
|
1085 |
-
|
|
|
1086 |
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
|
1095 |
|
1096 |
|
1097 |
-
|
1098 |
-
|
1099 |
|
1100 |
-
|
1101 |
|
1102 |
-
|
1103 |
-
|
1104 |
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
|
1109 |
-
|
1110 |
|
1111 |
-
|
1112 |
|
1113 |
-
|
1114 |
|
1115 |
?>
|
1116 |
-
|
1117 |
field-wp_editor-wrapper-<?php echo $id; ?>">
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
|
1124 |
<?php
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
-
|
1130 |
-
|
1131 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1132 |
|
1133 |
-
|
|
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
-
|
|
|
1141 |
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
|
1150 |
-
|
1151 |
-
|
1152 |
|
1153 |
-
|
1154 |
-
|
1155 |
|
1156 |
-
|
1157 |
|
1158 |
-
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
-
|
1164 |
?>
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
|
|
|
|
1189 |
})
|
1190 |
-
|
1191 |
-
</script>
|
1192 |
<?php
|
1193 |
|
1194 |
-
|
1195 |
|
1196 |
-
|
1197 |
-
|
1198 |
-
}
|
1199 |
|
1200 |
|
1201 |
|
1202 |
-
|
|
|
1203 |
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
|
1209 |
-
|
1210 |
-
|
1211 |
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
|
1216 |
-
|
1217 |
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
|
1222 |
-
|
1223 |
-
|
1224 |
|
1225 |
-
|
1226 |
|
1227 |
|
1228 |
-
|
1229 |
?>
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
|
|
1241 |
})
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
<?php
|
1256 |
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
|
1261 |
|
1262 |
|
1263 |
-
|
|
|
1264 |
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
|
1274 |
-
|
1275 |
-
|
1276 |
|
1277 |
-
|
1278 |
-
|
1279 |
|
1280 |
-
|
1281 |
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
|
1286 |
|
1287 |
-
|
1288 |
?>
|
1289 |
-
|
1290 |
<?php
|
1291 |
|
1292 |
-
|
1293 |
|
1294 |
-
|
1295 |
-
|
1296 |
-
}
|
1297 |
|
1298 |
|
1299 |
|
1300 |
-
|
|
|
1301 |
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
|
1311 |
-
|
1312 |
-
|
1313 |
|
1314 |
-
|
1315 |
-
|
1316 |
|
1317 |
-
|
1318 |
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
|
1323 |
|
1324 |
-
|
1325 |
?>
|
1326 |
-
|
1327 |
<?php
|
1328 |
|
1329 |
-
|
1330 |
-
|
1331 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1332 |
|
1333 |
-
|
|
|
1334 |
|
1335 |
|
1336 |
|
1337 |
-
|
|
|
1338 |
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
|
1348 |
-
|
1349 |
-
|
1350 |
|
1351 |
-
|
1352 |
-
|
1353 |
|
1354 |
-
|
1355 |
|
1356 |
-
|
1357 |
-
|
1358 |
|
1359 |
|
1360 |
-
|
1361 |
?>
|
1362 |
-
|
1363 |
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
<?php
|
1370 |
|
1371 |
-
|
1372 |
-
|
1373 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1374 |
-
|
1375 |
-
|
1376 |
|
1377 |
-
|
1378 |
-
|
1379 |
|
1380 |
|
1381 |
-
|
|
|
1382 |
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
|
1393 |
-
|
1394 |
-
|
1395 |
|
1396 |
-
|
1397 |
-
|
1398 |
|
1399 |
-
|
1400 |
-
|
1401 |
|
1402 |
-
|
1403 |
?>
|
1404 |
|
1405 |
-
|
1406 |
-
|
1407 |
-
ob_start();
|
1408 |
-
?>
|
1409 |
-
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1410 |
-
<script>
|
1411 |
-
|
1412 |
-
|
1413 |
-
jQuery(document).ready(function($){
|
1414 |
-
|
1415 |
-
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1416 |
-
|
1417 |
-
|
1418 |
-
})
|
1419 |
|
|
|
|
|
|
|
|
|
|
|
1420 |
|
|
|
1421 |
|
1422 |
|
1423 |
-
|
|
|
1424 |
<?php
|
1425 |
|
1426 |
-
|
1427 |
-
|
1428 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1429 |
|
1430 |
-
|
|
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
-
|
|
|
1437 |
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
|
1445 |
-
|
1446 |
-
|
1447 |
|
1448 |
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
|
1453 |
-
|
1454 |
|
1455 |
|
1456 |
|
1457 |
?>
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
|
1463 |
|
1464 |
|
1465 |
-
|
1466 |
-
|
1467 |
|
1468 |
|
1469 |
-
|
1470 |
-
|
1471 |
|
1472 |
-
|
1473 |
|
1474 |
|
1475 |
-
|
1476 |
-
<label for='<?php echo $for
|
1477 |
|
1478 |
<?php
|
1479 |
|
1480 |
-
|
1481 |
-
|
1482 |
<br>
|
1483 |
-
|
1484 |
-
|
1485 |
|
1486 |
-
|
1487 |
|
1488 |
-
|
1489 |
-
|
|
|
1490 |
</div>
|
1491 |
-
|
1492 |
-
<?php
|
1493 |
-
|
1494 |
-
|
1495 |
-
}
|
1496 |
|
1497 |
|
|
|
1498 |
|
1499 |
-
public function field_radio( $option ){
|
1500 |
|
1501 |
-
$id = isset( $option['id'] ) ? $option['id'] : "";
|
1502 |
-
$css_id = isset( $option['css_id'] ) ? $option['css_id'] : $id;
|
1503 |
-
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
1504 |
-
$field_template = isset( $option['field_template'] ) ? $option['field_template'] : $this->field_template($option);
|
1505 |
-
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1506 |
-
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1507 |
-
$for = isset( $option['for'] ) ? $option['for'] : "";
|
1508 |
-
$args = isset( $option['args'] ) ? $option['args'] : array();
|
1509 |
|
1510 |
-
|
1511 |
-
|
1512 |
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
|
|
|
|
|
|
|
|
|
|
1516 |
|
1517 |
-
|
|
|
1518 |
|
|
|
|
|
|
|
1519 |
|
1520 |
-
|
1521 |
|
1522 |
-
if(!empty($args))
|
1523 |
-
foreach( $args as $key => $value ):
|
1524 |
-
$checked = ( $key == $option_value ) ? "checked" : "";
|
1525 |
-
$for = !empty($for) ? $for.'-'.$css_id."-".$key : $css_id."-".$key;
|
1526 |
-
?>
|
1527 |
-
<label for="<?php echo $for;?>"><input name="<?php echo $field_name; ?>" type="radio" id="<?php echo $for; ?>" value="<?php echo $key;?>" <?php echo $checked;?>><span><?php echo $value;?></span></label>
|
1528 |
|
1529 |
-
|
1530 |
-
endforeach;
|
1531 |
|
1532 |
-
|
|
|
|
|
|
|
|
|
|
|
1533 |
|
1534 |
-
|
|
|
1535 |
|
|
|
1536 |
|
1537 |
-
|
|
|
1538 |
|
1539 |
|
1540 |
|
1541 |
-
|
|
|
1542 |
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
|
1553 |
-
|
1554 |
-
|
1555 |
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
|
1560 |
-
|
1561 |
|
1562 |
-
|
1563 |
|
1564 |
-
|
1565 |
|
1566 |
|
1567 |
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
|
1581 |
-
|
1582 |
|
1583 |
-
|
1584 |
|
1585 |
?>
|
1586 |
-
|
1587 |
-
|
1588 |
|
1589 |
-
|
1590 |
-
|
1591 |
|
1592 |
?>
|
1593 |
-
|
1594 |
-
|
1595 |
|
1596 |
<?php
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
|
1609 |
-
|
1610 |
-
|
1611 |
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
<style >
|
1617 |
-
.radio-img{}
|
1618 |
-
.radio-img label{
|
1619 |
-
display: inline-block;
|
1620 |
-
vertical-align: top;
|
1621 |
-
margin: 5px;
|
1622 |
-
padding: 2px;
|
1623 |
-
background: #eee;
|
1624 |
-
position: relative;
|
1625 |
-
}
|
1626 |
|
1627 |
-
|
1628 |
-
|
1629 |
-
}
|
1630 |
|
1631 |
-
|
1632 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1633 |
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
opacity: .3;
|
1638 |
-
}
|
1639 |
|
1640 |
-
|
1641 |
-
|
1642 |
-
position: absolute;
|
1643 |
-
top: 50%;
|
1644 |
-
left: 50%;
|
1645 |
-
transform: translate(-50%,-50%);
|
1646 |
-
padding: 0 10px;
|
1647 |
|
1648 |
-
|
1649 |
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
/* transform: translate(0%,-50%); */
|
1655 |
-
padding: 3px 14px;
|
1656 |
-
text-decoration: none;
|
1657 |
-
font-size: 14px;
|
1658 |
-
color: #fff;
|
1659 |
-
right: 2px;
|
1660 |
|
1661 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1662 |
|
|
|
1663 |
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1668 |
|
1669 |
-
|
1670 |
-
width: 100%;
|
1671 |
-
}
|
1672 |
|
1673 |
-
</style>
|
1674 |
-
<?php
|
1675 |
|
1676 |
-
|
|
|
|
|
|
|
|
|
1677 |
|
1678 |
-
|
|
|
|
|
|
|
|
|
1679 |
|
|
|
1680 |
|
1681 |
-
|
|
|
1682 |
|
1683 |
-
|
|
|
1684 |
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
|
1692 |
-
|
1693 |
-
|
1694 |
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
|
1699 |
-
|
1700 |
-
|
1701 |
|
1702 |
-
|
1703 |
|
1704 |
|
1705 |
-
|
1706 |
-
|
1707 |
|
1708 |
-
|
1709 |
?>
|
1710 |
-
|
1711 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1712 |
<?php
|
1713 |
|
1714 |
-
|
1715 |
|
1716 |
-
|
1717 |
-
|
1718 |
|
1719 |
|
1720 |
|
1721 |
-
|
|
|
1722 |
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
|
1729 |
-
|
1730 |
-
|
1731 |
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
|
1736 |
-
|
1737 |
-
|
1738 |
|
1739 |
-
|
1740 |
|
1741 |
-
|
1742 |
?>
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
$input_html = ob_get_clean();
|
1747 |
-
|
1748 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1749 |
-
}
|
1750 |
-
|
1751 |
-
|
1752 |
-
public function field_colorpicker_multi( $option ){
|
1753 |
-
|
1754 |
-
$id = isset( $option['id'] ) ? $option['id'] : "";
|
1755 |
-
$css_id = isset( $option['css_id'] ) ? $option['css_id'] : $id;
|
1756 |
-
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
1757 |
-
$field_template = isset( $option['field_template'] ) ? $option['field_template'] : $this->field_template($option);
|
1758 |
-
$args = isset( $option['args'] ) ? $option['args'] : "";
|
1759 |
-
|
1760 |
|
1761 |
-
|
1762 |
-
$pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
|
1763 |
|
1764 |
-
|
1765 |
-
|
1766 |
-
$value = !empty($value) ? $value : $default;
|
1767 |
|
1768 |
-
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1769 |
-
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1770 |
|
1771 |
-
|
|
|
1772 |
|
|
|
|
|
|
|
|
|
|
|
1773 |
|
1774 |
|
1775 |
-
|
|
|
1776 |
|
1777 |
-
|
|
|
|
|
1778 |
|
1779 |
-
|
|
|
1780 |
|
1781 |
-
|
1782 |
|
1783 |
-
$item_value = isset($value[$arg_key]) ? $value[$arg_key] : $arg;
|
1784 |
|
1785 |
|
1786 |
-
|
1787 |
-
<div class="">
|
1788 |
-
<span><?php echo $arg_key; ?></span>
|
1789 |
-
<input name="<?php echo $field_name; ?>[<?php echo $arg_key; ?>]" id="<?php echo $arg_key.'-'.$css_id; ?>" value="<?php echo $item_value; ?>" />
|
1790 |
-
<script>jQuery(document).ready(function($) { $("#<?php echo $arg_key.'-'.$css_id; ?>").wpColorPicker();});</script>
|
1791 |
-
</div>
|
1792 |
|
1793 |
-
|
1794 |
-
endforeach;
|
1795 |
|
1796 |
-
|
1797 |
|
|
|
1798 |
|
1799 |
-
|
1800 |
-
|
1801 |
-
echo sprintf($field_template, $title, $input_html, $details);
|
1802 |
-
}
|
1803 |
|
1804 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1805 |
|
1806 |
-
|
|
|
1807 |
|
1808 |
-
|
1809 |
-
$css_id = isset( $option['css_id'] ) ? $option['css_id'] : $id;
|
1810 |
-
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
1811 |
-
$field_template = isset( $option['field_template'] ) ? $option['field_template'] : $this->field_template($option);
|
1812 |
-
$html = isset( $option['html'] ) ? $option['html'] : "";
|
1813 |
|
1814 |
-
$is_pro = isset( $option['is_pro'] ) ? $option['is_pro'] : false;
|
1815 |
-
$pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
|
1816 |
|
1817 |
-
|
1818 |
-
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1819 |
|
|
|
|
|
1820 |
|
1821 |
-
echo sprintf($field_template, $title, $html, $details);
|
1822 |
|
1823 |
|
|
|
|
|
1824 |
|
|
|
|
|
|
|
|
|
|
|
1825 |
|
|
|
|
|
1826 |
|
|
|
|
|
1827 |
|
1828 |
|
|
|
|
|
1829 |
}
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
}}
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
+
if (!class_exists('settings_tabs_field')) {
|
5 |
+
class settings_tabs_field
|
6 |
+
{
|
7 |
|
8 |
+
//public $asset_dir_url = '';
|
9 |
+
public $textdomain = 'settings-tabs';
|
10 |
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
|
14 |
+
// $this->asset_dir_url = isset($args['asset_dir_url']) ? $args['asset_dir_url'] : '';
|
15 |
+
// $this->textdomain = isset($args['textdomain']) ? $args['textdomain'] : '';
|
16 |
|
17 |
+
}
|
18 |
|
19 |
|
20 |
+
function admin_scripts()
|
21 |
+
{
|
22 |
|
23 |
|
24 |
+
wp_enqueue_script('jquery');
|
25 |
+
wp_enqueue_script('jquery-ui-sortable');
|
26 |
+
wp_enqueue_script('jquery-ui-core');
|
27 |
+
wp_enqueue_script('jquery-ui-accordion');
|
28 |
+
wp_enqueue_style('jquery-ui');
|
29 |
+
wp_enqueue_script('jquery-ui-tabs');
|
30 |
|
31 |
+
wp_enqueue_script('wp-color-picker');
|
32 |
+
wp_enqueue_style('wp-color-picker');
|
33 |
|
34 |
|
35 |
+
wp_enqueue_style('font-awesome-5');
|
36 |
|
37 |
+
wp_enqueue_style('settings-tabs');
|
38 |
+
wp_enqueue_script('settings-tabs');
|
39 |
|
40 |
+
wp_enqueue_script('code-editor');
|
41 |
+
wp_enqueue_style('code-editor');
|
42 |
|
43 |
+
wp_enqueue_script('jquery.lazy');
|
44 |
|
45 |
+
if (function_exists('wp_enqueue_editor')) {
|
46 |
+
wp_enqueue_editor();
|
47 |
+
}
|
48 |
}
|
49 |
|
50 |
+
function field_template($option)
|
51 |
+
{
|
52 |
|
53 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
54 |
+
$wraper_class = isset($option['wraper_class']) ? $option['wraper_class'] : "";
|
55 |
+
$conditions = isset($option['conditions']) ? $option['conditions'] : array();
|
|
|
|
|
|
|
|
|
56 |
|
57 |
+
$is_error = isset($option['is_error']) ? $option['is_error'] : false;
|
58 |
+
$error_details = isset($option['error_details']) ? $option['error_details'] : '';
|
59 |
|
60 |
|
61 |
|
62 |
+
if (!empty($conditions)) :
|
63 |
|
64 |
+
$depends = '';
|
65 |
|
66 |
+
$field = isset($conditions['field']) ? $conditions['field'] : '';
|
67 |
+
$cond_value = isset($conditions['value']) ? $conditions['value'] : '';
|
68 |
+
$type = isset($conditions['type']) ? $conditions['type'] : '';
|
69 |
+
$pattern = isset($conditions['pattern']) ? $conditions['pattern'] : '';
|
70 |
+
$modifier = isset($conditions['modifier']) ? $conditions['modifier'] : '';
|
71 |
+
$like = isset($conditions['like']) ? $conditions['like'] : '';
|
72 |
+
$strict = isset($conditions['strict']) ? $conditions['strict'] : '';
|
73 |
+
$empty = isset($conditions['empty']) ? $conditions['empty'] : '';
|
74 |
+
$sign = isset($conditions['sign']) ? $conditions['sign'] : '';
|
75 |
+
$min = isset($conditions['min']) ? $conditions['min'] : '';
|
76 |
+
$max = isset($conditions['max']) ? $conditions['max'] : '';
|
77 |
|
78 |
+
$depends .= "{'[name=$field]':";
|
79 |
+
$depends .= '{';
|
80 |
|
81 |
+
if (!empty($type)) :
|
82 |
+
$depends .= "'type':";
|
83 |
+
$depends .= "'" . $type . "'";
|
84 |
+
endif;
|
85 |
|
86 |
+
if (!empty($modifier)) :
|
87 |
+
$depends .= ",'modifier':";
|
88 |
+
$depends .= "'" . $modifier . "'";
|
89 |
+
endif;
|
90 |
|
91 |
+
if (!empty($like)) :
|
92 |
+
$depends .= ",'like':";
|
93 |
+
$depends .= "'" . $like . "'";
|
94 |
+
endif;
|
95 |
|
96 |
+
if (!empty($strict)) :
|
97 |
+
$depends .= ",'strict':";
|
98 |
+
$depends .= "'" . $strict . "'";
|
99 |
+
endif;
|
100 |
|
101 |
+
if (!empty($empty)) :
|
102 |
+
$depends .= ",'empty':";
|
103 |
+
$depends .= "'" . $empty . "'";
|
104 |
+
endif;
|
105 |
|
106 |
+
if (!empty($sign)) :
|
107 |
+
$depends .= ",'sign':";
|
108 |
+
$depends .= "'" . $sign . "'";
|
109 |
+
endif;
|
110 |
|
111 |
+
if (!empty($min)) :
|
112 |
+
$depends .= ",'min':";
|
113 |
+
$depends .= "'" . $min . "'";
|
114 |
+
endif;
|
115 |
|
116 |
+
if (!empty($max)) :
|
117 |
+
$depends .= ",'max':";
|
118 |
+
$depends .= "'" . $max . "'";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
endif;
|
120 |
+
if (!empty($cond_value)) :
|
121 |
+
$depends .= ",'value':";
|
122 |
+
if (is_array($cond_value)) :
|
123 |
+
$count = count($cond_value);
|
124 |
+
$i = 1;
|
125 |
+
$depends .= "[";
|
126 |
+
foreach ($cond_value as $val) :
|
127 |
+
$depends .= "'" . $val . "'";
|
128 |
+
if ($i < $count)
|
129 |
+
$depends .= ",";
|
130 |
+
$i++;
|
131 |
+
endforeach;
|
132 |
+
$depends .= "]";
|
133 |
+
else :
|
134 |
+
$depends .= "[";
|
135 |
+
$depends .= "'" . $cond_value . "'";
|
136 |
+
$depends .= "]";
|
137 |
+
endif;
|
138 |
+
endif;
|
139 |
+
$depends .= '}}';
|
140 |
|
141 |
+
endif;
|
142 |
|
143 |
|
144 |
|
145 |
+
ob_start();
|
146 |
|
147 |
+
?>
|
148 |
+
<div <?php if (!empty($depends)) { ?> data-depends="[<?php echo $depends; ?>]" <?php } ?> class="setting-field <?php if ($is_error) echo 'field-error'; ?> <?php echo $wraper_class; ?> <?php if (!empty($depends)) echo 'dependency-field'; ?>">
|
149 |
+
<div class="field-lable">%s</div>
|
150 |
+
<div class="field-input">%s
|
151 |
+
<p class="description">%s</p>
|
152 |
+
<?php if ($is_error && !empty($error_details)) : ?>
|
153 |
+
<p class="error-details"><i class="fas fa-exclamation-circle"></i> <?php echo $error_details; ?></p>
|
154 |
+
<?php endif; ?>
|
155 |
|
156 |
+
</div>
|
157 |
</div>
|
|
|
158 |
<?php
|
159 |
|
160 |
+
return ob_get_clean();
|
161 |
+
}
|
|
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
+
function generate_field($option)
|
169 |
+
{
|
170 |
|
171 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
172 |
+
$type = isset($option['type']) ? $option['type'] : "";
|
173 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
+
if (empty($id)) return;
|
181 |
|
182 |
+
if (isset($option['type']) && $option['type'] === 'select') $this->field_select($option);
|
183 |
+
elseif (isset($option['type']) && $option['type'] === 'select2') $this->field_select2($option);
|
184 |
+
elseif (isset($option['type']) && $option['type'] === 'checkbox') $this->field_checkbox($option);
|
185 |
+
elseif (isset($option['type']) && $option['type'] === 'radio') $this->field_radio($option);
|
186 |
+
elseif (isset($option['type']) && $option['type'] === 'radio_image') $this->field_radio_image($option);
|
187 |
+
elseif (isset($option['type']) && $option['type'] === 'textarea') $this->field_textarea($option);
|
188 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_js') $this->field_scripts_js($option);
|
189 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_css') $this->field_scripts_css($option);
|
190 |
+
elseif (isset($option['type']) && $option['type'] === 'number') $this->field_number($option);
|
191 |
+
elseif (isset($option['type']) && $option['type'] === 'text') $this->field_text($option);
|
192 |
+
elseif (isset($option['type']) && $option['type'] === 'text_icon') $this->field_text_icon($option);
|
193 |
+
elseif (isset($option['type']) && $option['type'] === 'text_multi') $this->field_text_multi($option);
|
194 |
+
elseif (isset($option['type']) && $option['type'] === 'hidden') $this->field_hidden($option);
|
195 |
|
196 |
+
elseif (isset($option['type']) && $option['type'] === 'range') $this->field_range($option);
|
197 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker') $this->field_colorpicker($option);
|
198 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi') $this->field_colorpicker_multi($option);
|
199 |
|
200 |
+
elseif (isset($option['type']) && $option['type'] === 'datepicker') $this->field_datepicker($option);
|
201 |
+
elseif (isset($option['type']) && $option['type'] === 'faq') $this->field_faq($option);
|
202 |
+
elseif (isset($option['type']) && $option['type'] === 'addons_grid') $this->field_addons_grid($option);
|
203 |
+
elseif (isset($option['type']) && $option['type'] === 'custom_html') $this->field_custom_html($option);
|
204 |
+
elseif (isset($option['type']) && $option['type'] === 'repeatable') $this->field_repeatable($option);
|
205 |
+
elseif (isset($option['type']) && $option['type'] === 'media') $this->field_media($option);
|
206 |
+
elseif (isset($option['type']) && $option['type'] === 'media_url') $this->field_media_url($option);
|
207 |
|
208 |
+
elseif (isset($option['type']) && $option['type'] === 'option_group') $this->field_option_group($option);
|
209 |
+
elseif (isset($option['type']) && $option['type'] === 'option_group_accordion') $this->field_option_group_accordion($option);
|
210 |
+
elseif (isset($option['type']) && $option['type'] === 'wp_editor') $this->field_wp_editor($option);
|
211 |
+
elseif (isset($option['type']) && $option['type'] === 'textarea_editor') $this->field_textarea_editor($option);
|
212 |
|
213 |
|
214 |
|
215 |
+
elseif (isset($option['type']) && $option['type'] === $type) do_action("settings_tabs_field_$type", $option);
|
216 |
|
217 |
|
218 |
+
//if( !empty( $details ) ) echo "<p class='description'>$details</p>";
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
+
}
|
225 |
|
226 |
|
227 |
+
public function field_option_group_accordion($option)
|
228 |
+
{
|
229 |
|
230 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
231 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
232 |
+
$sortable = isset($option['sortable']) ? $option['sortable'] : false;
|
233 |
|
234 |
+
$args_index = isset($option['args_index']) ? $option['args_index'] : array();
|
235 |
+
$args_index_default = isset($option['args_index_default']) ? $option['args_index_default'] : array();
|
236 |
+
$args_index_hide = isset($option['args_index_hide']) ? $option['args_index_hide'] : array();
|
237 |
|
238 |
+
$args_index = !empty($args_index) ? $args_index : $args_index_default;
|
239 |
|
240 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
241 |
|
242 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
243 |
|
244 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
245 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
246 |
|
247 |
|
248 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
249 |
+
$group_details = isset($option['details']) ? $option['details'] : "";
|
250 |
|
251 |
+
if ($is_pro == true) {
|
252 |
+
$group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
|
253 |
+
}
|
254 |
|
255 |
|
256 |
+
ob_start();
|
257 |
?>
|
258 |
+
<div class="option-group-accordion-wrap" id="<?php echo $css_id; ?>">
|
259 |
+
<div sortable="<?php echo ($sortable) ? 'true' : 'false'; ?>" class='option-group-accordion accordion'>
|
260 |
+
<?php
|
261 |
|
262 |
+
if (!empty($args_index))
|
263 |
+
foreach ($args_index as $index) :
|
264 |
|
265 |
+
//foreach( $args as $key => $value ):
|
266 |
|
267 |
+
$group_title = isset($args[$index]['title']) ? $args[$index]['title'] : '';
|
268 |
+
$is_hide = isset($args_index_hide[$index]) ? $args_index_hide[$index] : false;
|
269 |
|
270 |
|
271 |
+
//$link = $value['link'];
|
272 |
+
$options = isset($args[$index]['options']) ? $args[$index]['options'] : array();
|
273 |
|
274 |
+
?>
|
275 |
<div class="group">
|
276 |
<h3 class="accordion-title">
|
277 |
|
278 |
|
279 |
+
<?php if ($sortable) : ?>
|
280 |
<span class="sort"><i class="fas fa-sort"></i></span>
|
281 |
<?php endif; ?>
|
282 |
|
286 |
|
287 |
<?php
|
288 |
|
289 |
+
if (!empty($options)) :
|
290 |
+
foreach ($options as $option) :
|
291 |
+
|
292 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
293 |
+
$type = isset($option['type']) ? $option['type'] : "";
|
294 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
295 |
+
|
296 |
+
if (isset($option['type']) && $option['type'] === 'select') $this->field_select($option);
|
297 |
+
elseif (isset($option['type']) && $option['type'] === 'select2') $this->field_select2($option);
|
298 |
+
elseif (isset($option['type']) && $option['type'] === 'checkbox') $this->field_checkbox($option);
|
299 |
+
elseif (isset($option['type']) && $option['type'] === 'radio') $this->field_radio($option);
|
300 |
+
elseif (isset($option['type']) && $option['type'] === 'radio_image') $this->field_radio_image($option);
|
301 |
+
elseif (isset($option['type']) && $option['type'] === 'textarea') $this->field_textarea($option);
|
302 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_js') $this->field_scripts_js($option);
|
303 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_css') $this->field_scripts_css($option);
|
304 |
+
elseif (isset($option['type']) && $option['type'] === 'number') $this->field_number($option);
|
305 |
+
elseif (isset($option['type']) && $option['type'] === 'text') $this->field_text($option);
|
306 |
+
elseif (isset($option['type']) && $option['type'] === 'text_icon') $this->field_text_icon($option);
|
307 |
+
elseif (isset($option['type']) && $option['type'] === 'text_multi') $this->field_text_multi($option);
|
308 |
+
elseif (isset($option['type']) && $option['type'] === 'hidden') $this->field_hidden($option);
|
309 |
+
|
310 |
+
elseif (isset($option['type']) && $option['type'] === 'range') $this->field_range($option);
|
311 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker') $this->field_colorpicker($option);
|
312 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi') $this->field_colorpicker_multi($option);
|
313 |
+
|
314 |
+
elseif (isset($option['type']) && $option['type'] === 'datepicker') $this->field_datepicker($option);
|
315 |
+
elseif (isset($option['type']) && $option['type'] === 'faq') $this->field_faq($option);
|
316 |
+
elseif (isset($option['type']) && $option['type'] === 'addons_grid') $this->field_addons_grid($option);
|
317 |
+
elseif (isset($option['type']) && $option['type'] === 'custom_html') $this->field_custom_html($option);
|
318 |
+
elseif (isset($option['type']) && $option['type'] === 'repeatable') $this->field_repeatable($option);
|
319 |
+
elseif (isset($option['type']) && $option['type'] === 'media') $this->field_media($option);
|
320 |
+
elseif (isset($option['type']) && $option['type'] === 'media_url') $this->field_media_url($option);
|
321 |
|
322 |
endforeach;
|
323 |
endif;
|
327 |
|
328 |
|
329 |
<?php
|
330 |
+
//endforeach;
|
331 |
|
332 |
+
endforeach;
|
333 |
|
334 |
|
335 |
+
?>
|
336 |
+
</div> <!-- .option-group-accordion -->
|
337 |
+
</div><!-- .option-group-accordion-wrap -->
|
338 |
|
339 |
<?php
|
340 |
|
341 |
+
$input_html = ob_get_clean();
|
|
|
|
|
|
|
342 |
|
343 |
+
echo sprintf($field_template, $title, $input_html, $group_details);
|
344 |
+
}
|
345 |
|
346 |
|
347 |
+
public function field_option_group($option)
|
348 |
+
{
|
349 |
|
350 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
351 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
352 |
+
$options = isset($option['options']) ? $option['options'] : array();
|
353 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
354 |
|
355 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
356 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
357 |
|
358 |
|
359 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
360 |
+
$group_details = isset($option['details']) ? $option['details'] : "";
|
361 |
|
362 |
+
if ($is_pro == true) {
|
363 |
+
$group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
|
364 |
+
}
|
365 |
|
366 |
|
367 |
+
ob_start();
|
368 |
?>
|
369 |
+
<div id="<?php echo $css_id; ?>">
|
370 |
+
<?php
|
371 |
|
372 |
+
if (!empty($options)) :
|
373 |
+
foreach ($options as $option) :
|
374 |
+
|
375 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
376 |
+
$type = isset($option['type']) ? $option['type'] : "";
|
377 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
378 |
+
|
379 |
+
if (isset($option['type']) && $option['type'] === 'select') $this->field_select($option);
|
380 |
+
elseif (isset($option['type']) && $option['type'] === 'select2') $this->field_select2($option);
|
381 |
+
elseif (isset($option['type']) && $option['type'] === 'checkbox') $this->field_checkbox($option);
|
382 |
+
elseif (isset($option['type']) && $option['type'] === 'radio') $this->field_radio($option);
|
383 |
+
elseif (isset($option['type']) && $option['type'] === 'radio_image') $this->field_radio_image($option);
|
384 |
+
elseif (isset($option['type']) && $option['type'] === 'textarea') $this->field_textarea($option);
|
385 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_js') $this->field_scripts_js($option);
|
386 |
+
elseif (isset($option['type']) && $option['type'] === 'scripts_css') $this->field_scripts_css($option);
|
387 |
+
elseif (isset($option['type']) && $option['type'] === 'number') $this->field_number($option);
|
388 |
+
elseif (isset($option['type']) && $option['type'] === 'text') $this->field_text($option);
|
389 |
+
elseif (isset($option['type']) && $option['type'] === 'text_icon') $this->field_text_icon($option);
|
390 |
+
elseif (isset($option['type']) && $option['type'] === 'text_multi') $this->field_text_multi($option);
|
391 |
+
elseif (isset($option['type']) && $option['type'] === 'hidden') $this->field_hidden($option);
|
392 |
+
|
393 |
+
elseif (isset($option['type']) && $option['type'] === 'range') $this->field_range($option);
|
394 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker') $this->field_colorpicker($option);
|
395 |
+
elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi') $this->field_colorpicker_multi($option);
|
396 |
+
|
397 |
+
elseif (isset($option['type']) && $option['type'] === 'datepicker') $this->field_datepicker($option);
|
398 |
+
elseif (isset($option['type']) && $option['type'] === 'faq') $this->field_faq($option);
|
399 |
+
elseif (isset($option['type']) && $option['type'] === 'addons_grid') $this->field_addons_grid($option);
|
400 |
+
elseif (isset($option['type']) && $option['type'] === 'custom_html') $this->field_custom_html($option);
|
401 |
+
elseif (isset($option['type']) && $option['type'] === 'repeatable') $this->field_repeatable($option);
|
402 |
+
elseif (isset($option['type']) && $option['type'] === 'media') $this->field_media($option);
|
403 |
+
elseif (isset($option['type']) && $option['type'] === 'media_url') $this->field_media_url($option);
|
404 |
|
405 |
+
endforeach;
|
406 |
+
endif;
|
407 |
+
?>
|
408 |
+
</div>
|
409 |
<?php
|
410 |
|
411 |
+
$input_html = ob_get_clean();
|
|
|
|
|
|
|
412 |
|
413 |
+
echo sprintf($field_template, $title, $input_html, $group_details);
|
414 |
+
}
|
415 |
|
416 |
|
417 |
+
public function field_media($option)
|
418 |
+
{
|
419 |
|
420 |
|
421 |
|
422 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
423 |
+
if (empty($id)) return;
|
424 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
425 |
+
$field_name = isset($option['field_name']) ? $option['field_name'] : $id;
|
426 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
427 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
428 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
429 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
430 |
|
431 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
432 |
|
433 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
434 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
435 |
|
436 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
437 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
438 |
+
$value = !empty($value) ? $value : $default;
|
439 |
|
440 |
+
$media_url = wp_get_attachment_url($value);
|
441 |
+
$media_type = get_post_mime_type($value);
|
442 |
+
$media_title = !empty($value) ? get_the_title($value) : __('Placeholder.jpg', $this->textdomain);
|
443 |
|
444 |
|
445 |
+
$media_url = !empty($media_url) ? $media_url : $default;
|
446 |
+
$media_url = !empty($media_url) ? $media_url : $placeholder;
|
447 |
+
$media_basename = wp_basename($media_type);
|
448 |
|
449 |
+
$field_name = !empty($field_name) ? $field_name : $id;
|
450 |
+
$field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
|
451 |
|
452 |
|
453 |
|
454 |
+
ob_start();
|
455 |
+
//wp_enqueue_media();
|
456 |
|
457 |
?>
|
458 |
+
<div id="input-wrapper-<?php echo $css_id; ?>" class="input-wrapper field-media-wrapper
|
459 |
field-media-wrapper-<?php echo $css_id; ?>">
|
460 |
+
<div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px; text-align: center;word-break: break-all;">
|
461 |
+
<?php
|
462 |
|
463 |
+
//var_dump($media_type);
|
464 |
|
465 |
+
if ("audio/mpeg" == $media_type) {
|
466 |
?>
|
467 |
+
<div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
|
468 |
+
<div class="media-title"><?php echo $media_title; ?></div>
|
469 |
<?php
|
470 |
+
} elseif (
|
471 |
+
"images/png" == $media_type ||
|
472 |
+
"image/png" == $media_type ||
|
473 |
+
"images/gif" == $media_type ||
|
474 |
+
"image/gif" == $media_type ||
|
475 |
+
"images/jpeg" == $media_type ||
|
476 |
+
"image/jpeg" == $media_type ||
|
477 |
+
"images/jpg" == $media_type ||
|
478 |
+
"image/jpg" == $media_type ||
|
479 |
+
"images/ico" == $media_type ||
|
480 |
+
"image/ico" == $media_type
|
481 |
+
) {
|
482 |
?>
|
483 |
+
<img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
|
484 |
+
<div class="media-title"><?php echo $media_title; ?></div>
|
485 |
<?php
|
486 |
+
} else {
|
487 |
?>
|
488 |
+
<img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
|
489 |
+
<div class="media-title"><?php echo $media_title; ?></div>
|
490 |
|
491 |
<?php
|
492 |
+
}
|
493 |
+
?>
|
494 |
+
</div>
|
495 |
+
<input class="media-input-value" type="hidden" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
496 |
+
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain); ?></div>
|
497 |
+
<div placeholder="<?php echo $placeholder; ?>" class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear', $this->textdomain); ?></div>
|
498 |
+
<div class="error-mgs"></div>
|
499 |
</div>
|
|
|
|
|
|
|
|
|
|
|
500 |
|
501 |
<?php
|
502 |
|
503 |
|
504 |
+
$input_html = ob_get_clean();
|
505 |
|
506 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
507 |
+
}
|
|
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
+
public function field_media_url($option)
|
513 |
+
{
|
514 |
|
515 |
|
516 |
|
517 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
518 |
+
if (empty($id)) return;
|
519 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
520 |
+
$field_name = isset($option['field_name']) ? $option['field_name'] : $id;
|
521 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
522 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
523 |
+
$placeholder_img = isset($option['placeholder_img']) ? $option['placeholder_img'] : "";
|
524 |
|
525 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
526 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
527 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
528 |
|
529 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
530 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
531 |
|
532 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
533 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
534 |
+
$value = !empty($value) ? $value : $default;
|
535 |
|
536 |
+
$media_url = $value;
|
537 |
+
$media_type = get_post_mime_type($value);
|
538 |
+
$media_title = get_the_title($value);
|
539 |
+
$media_url = !empty($media_url) ? $media_url : '';
|
540 |
+
$media_url = !empty($media_url) ? $media_url : $placeholder_img;
|
541 |
|
542 |
+
$field_name = !empty($field_name) ? $field_name : $id;
|
543 |
+
$field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
|
544 |
|
545 |
|
546 |
+
wp_enqueue_media();
|
547 |
+
ob_start();
|
548 |
|
549 |
|
550 |
?>
|
551 |
+
<div id="input-wrapper-<?php echo $css_id; ?>" class="input-wrapper field-media-url-wrapper
|
552 |
field-media-wrapper-<?php echo $css_id; ?>">
|
553 |
+
<div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px; text-align: center;">
|
554 |
+
<?php
|
555 |
|
556 |
+
if ("audio/mpeg" == $media_type) {
|
557 |
?>
|
558 |
+
<div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
|
559 |
|
560 |
<?php
|
561 |
+
} elseif (
|
562 |
+
"images/png" == $media_type || "images/jpg" == $media_type || "images/jpeg" == $media_type ||
|
563 |
+
"images/gif" == $media_type ||
|
564 |
+
"images/ico" == $media_type
|
565 |
+
) {
|
566 |
?>
|
567 |
+
<img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
|
568 |
|
569 |
<?php
|
570 |
+
} else {
|
|
|
|
|
571 |
?>
|
572 |
+
<img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
|
573 |
|
574 |
<?php
|
575 |
+
}
|
576 |
+
?>
|
577 |
+
</div>
|
578 |
+
<input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
579 |
+
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain); ?></div>
|
580 |
+
<div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear', 'post-grid'); ?></div>
|
581 |
+
<div class="error-mgs"></div>
|
582 |
</div>
|
|
|
|
|
|
|
|
|
|
|
583 |
|
584 |
<?php
|
585 |
|
586 |
|
587 |
+
$input_html = ob_get_clean();
|
|
|
|
|
588 |
|
589 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
590 |
+
}
|
591 |
|
592 |
|
593 |
|
594 |
+
public function field_repeatable($option)
|
595 |
+
{
|
596 |
|
597 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
598 |
+
if (empty($id)) return;
|
599 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
600 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
601 |
+
$field_name = isset($option['field_name']) ? $option['field_name'] : $id;
|
602 |
+
$field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
|
603 |
|
604 |
+
$sortable = isset($option['sortable']) ? $option['sortable'] : true;
|
605 |
+
$collapsible = isset($option['collapsible']) ? $option['collapsible'] : true;
|
606 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
607 |
+
$values = isset($option['value']) ? $option['value'] : array();
|
608 |
+
$fields = isset($option['fields']) ? $option['fields'] : array();
|
609 |
+
$title_field = isset($option['title_field']) ? $option['title_field'] : '';
|
610 |
+
$remove_text = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
|
611 |
+
$limit = isset($option['limit']) ? $option['limit'] : '';
|
612 |
|
613 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
614 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
615 |
|
616 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
617 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
618 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
619 |
|
620 |
+
$settings_tabs_field = new settings_tabs_field();
|
621 |
|
622 |
|
623 |
+
ob_start();
|
624 |
?>
|
625 |
+
<div class="item-wrap collapsible">
|
626 |
+
<div class="header">
|
627 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span>
|
628 |
+
<?php
|
629 |
+
if ($sortable) :
|
630 |
+
?>
|
631 |
+
<span class="sort"><i class="fas fa-arrows-alt"></i></span>
|
632 |
+
<?php
|
633 |
+
endif;
|
634 |
?>
|
635 |
+
<span class="title-text">#TIMEINDEX</span>
|
636 |
+
</div>
|
637 |
<?php
|
|
|
|
|
|
|
|
|
|
|
638 |
|
639 |
|
640 |
+
if (!empty($fields)) :
|
641 |
+
foreach ($fields as $field) :
|
642 |
|
643 |
+
$fieldType = isset($field['type']) ? $field['type'] : '';
|
644 |
+
$field['parent'] = $field_name . '[TIMEINDEX]';
|
645 |
|
646 |
|
647 |
+
?>
|
648 |
+
<div class="item">
|
649 |
+
<?php if ($collapsible) : ?>
|
650 |