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 |
+
<div class="content">
|
651 |
+
<?php endif; ?>
|
652 |
+
|
653 |
+
<?php
|
654 |
+
$settings_tabs_field->generate_field($field);
|
655 |
+
?>
|
656 |
+
<?php if ($collapsible) : ?>
|
657 |
+
</div>
|
658 |
<?php endif; ?>
|
659 |
|
|
|
|
|
|
|
|
|
660 |
</div>
|
|
|
|
|
|
|
661 |
<?php
|
662 |
|
663 |
+
endforeach;
|
664 |
+
endif;
|
665 |
+
?>
|
666 |
+
</div>
|
667 |
+
<?php
|
668 |
|
669 |
+
$fieldHtml = ob_get_clean();
|
670 |
|
671 |
+
$fieldHtml = preg_replace("/[\r\n]+/", "\n", $fieldHtml);
|
672 |
+
$fieldHtml = preg_replace("/\s+/", ' ', $fieldHtml);
|
673 |
|
674 |
|
675 |
+
ob_start();
|
676 |
+
?>
|
677 |
|
678 |
|
679 |
+
<div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
|
680 |
field-repeatable-wrapper-<?php echo $css_id; ?>">
|
681 |
+
<div add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add', 'post-grid'); ?></div>
|
682 |
+
<div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
|
683 |
+
<?php
|
684 |
+
if (!empty($values)) :
|
685 |
+
$count = 1;
|
686 |
+
foreach ($values as $index => $val) :
|
687 |
+
$title_field_val = !empty($val[$title_field]) ? $val[$title_field] : '#' . $count;
|
688 |
|
689 |
+
//var_dump($index);
|
690 |
|
691 |
+
?>
|
692 |
+
<div class="item-wrap <?php if ($collapsible) echo 'collapsible'; ?>" index="<?php echo $index; ?>">
|
693 |
+
<?php if ($collapsible) : ?>
|
694 |
+
<div class="header">
|
695 |
+
<?php endif; ?>
|
696 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span>
|
697 |
+
<?php if ($sortable) : ?>
|
698 |
+
<span class="sort"><i class="fas fa-arrows-alt"></i></span>
|
699 |
+
<?php endif; ?>
|
700 |
+
|
701 |
+
<span class="title-text"><?php echo $title_field_val; ?></span>
|
702 |
+
<?php if ($collapsible) : ?>
|
703 |
+
</div>
|
704 |
<?php endif; ?>
|
705 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
706 |
|
707 |
|
708 |
|
709 |
+
foreach ($fields as $field_index => $field) :
|
710 |
+
$fieldId = $field['id'];
|
711 |
+
$field_css_id = isset($field['css_id']) ? str_replace('TIMEINDEX', $index, $field['css_id']) : '';
|
712 |
|
713 |
+
//var_dump($field_css_id);
|
714 |
|
715 |
+
$title_field_class = ($title_field == $field_index) ? 'title-field' : '';
|
716 |
?>
|
717 |
+
<div class="item <?php echo $title_field_class; ?>">
|
718 |
+
<?php if ($collapsible) : ?>
|
719 |
+
<div class="content">
|
720 |
+
<?php endif; ?>
|
721 |
|
722 |
+
<?php
|
723 |
+
$field['parent'] = $field_name . '[' . $index . ']';
|
724 |
+
$field['css_id'] = $field_css_id;
|
725 |
|
726 |
+
$field['value'] = isset($val[$fieldId]) ? $val[$fieldId] : '';
|
727 |
|
728 |
+
$settings_tabs_field->generate_field($field);
|
729 |
|
730 |
|
731 |
+
if ($collapsible) : ?>
|
732 |
+
</div>
|
733 |
+
<?php endif; ?>
|
734 |
</div>
|
735 |
+
<?php
|
|
|
|
|
736 |
|
737 |
+
endforeach; ?>
|
738 |
+
</div>
|
739 |
<?php
|
740 |
+
$count++;
|
741 |
+
endforeach;
|
742 |
+
else :
|
743 |
+
?>
|
744 |
+
<?php
|
745 |
+
endif;
|
746 |
?>
|
747 |
+
</div>
|
748 |
+
<div class="error-mgs"></div>
|
|
|
749 |
</div>
|
|
|
|
|
750 |
|
751 |
<?php
|
752 |
|
753 |
+
$input_html = ob_get_clean();
|
754 |
|
755 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
756 |
+
}
|
|
|
|
|
|
|
757 |
|
758 |
|
759 |
|
762 |
|
763 |
|
764 |
|
765 |
+
public function field_select($option)
|
766 |
+
{
|
767 |
|
768 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
769 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
770 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
771 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
772 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
773 |
+
$multiple = isset($option['multiple']) ? $option['multiple'] : false;
|
774 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
775 |
|
776 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
777 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
778 |
|
779 |
|
780 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
781 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
782 |
|
783 |
+
if ($is_pro == true) {
|
784 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
785 |
+
}
|
786 |
|
787 |
|
788 |
+
if ($multiple) {
|
789 |
+
$value = isset($option['value']) ? $option['value'] : array();
|
790 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
|
791 |
+
$default = isset($option['default']) ? $option['default'] : array();
|
792 |
+
} else {
|
793 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
794 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
795 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
796 |
+
}
|
797 |
|
798 |
|
799 |
+
$value = !empty($value) ? $value : $default;
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
+
ob_start();
|
805 |
?>
|
806 |
|
807 |
+
<select <?php if ($multiple) echo 'multiple'; ?> name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>">
|
808 |
+
<?php
|
809 |
+
foreach ($args as $key => $name) :
|
810 |
+
if ($multiple) {
|
811 |
+
$selected = in_array($key, $value) ? "selected" : "";
|
812 |
+
} else {
|
813 |
+
$selected = $value == $key ? "selected" : "";
|
814 |
+
}
|
815 |
|
816 |
|
817 |
?>
|
818 |
+
<option <?php echo $selected; ?> value="<?php echo $key; ?>"><?php echo $name; ?></option>
|
819 |
+
<?php
|
820 |
+
endforeach;
|
821 |
+
?>
|
822 |
+
</select>
|
823 |
<?php
|
824 |
+
if ($multiple) :
|
825 |
?>
|
826 |
+
<div class="button select-reset">Reset</div><br>
|
827 |
+
<?php
|
828 |
+
endif;
|
829 |
?>
|
|
|
|
|
|
|
|
|
830 |
|
831 |
<?php
|
832 |
|
833 |
+
$input_html = ob_get_clean();
|
|
|
|
|
|
|
834 |
|
835 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
836 |
+
}
|
837 |
|
838 |
+
public function field_select2($option)
|
839 |
+
{
|
840 |
|
841 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
842 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
843 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
844 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
845 |
+
$multiple = isset($option['multiple']) ? $option['multiple'] : "";
|
846 |
+
$attributes = isset($option['attributes']) ? $option['attributes'] : array();
|
847 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
848 |
|
849 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
850 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
851 |
|
852 |
|
853 |
+
//var_dump($css_id);
|
854 |
|
855 |
+
if ($multiple) {
|
856 |
+
$value = isset($option['value']) ? $option['value'] : array();
|
857 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
|
858 |
+
$default = isset($option['default']) ? $option['default'] : array();
|
859 |
+
} else {
|
860 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
861 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
862 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
863 |
+
}
|
864 |
|
865 |
+
$value = !empty($value) ? $value : $default;
|
866 |
|
867 |
+
//$value = get_post_meta( $post_id, $id, true );
|
868 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
869 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
870 |
|
871 |
+
$attributes_html = '';
|
872 |
|
873 |
+
foreach ($attributes as $attributeId => $attribute) :
|
874 |
|
875 |
+
$attributes_html = $attributeId . '=' . $attribute . ' ';
|
876 |
|
877 |
+
endforeach;
|
878 |
|
879 |
|
880 |
+
ob_start();
|
881 |
?>
|
882 |
+
<select <?php echo $attributes_html; ?> class="select2" <?php if ($multiple) echo 'multiple'; ?> name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>">
|
883 |
+
<?php
|
884 |
+
foreach ($args as $key => $name) :
|
885 |
|
886 |
+
if ($multiple) {
|
887 |
+
$selected = in_array($key, $value) ? "selected" : "";
|
888 |
+
} else {
|
889 |
+
$selected = ($key == $value) ? "selected" : "";
|
890 |
+
}
|
891 |
|
892 |
?>
|
893 |
+
<option <?php echo $selected; ?> value="<?php echo $key; ?>"><?php echo $name; ?></option>
|
894 |
+
<?php
|
895 |
+
endforeach;
|
896 |
+
?>
|
897 |
+
</select>
|
898 |
<?php
|
899 |
|
900 |
+
$input_html = ob_get_clean();
|
901 |
|
902 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
903 |
+
}
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
+
public function field_text_multi($option)
|
910 |
+
{
|
911 |
|
912 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
913 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
914 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
915 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
916 |
|
917 |
+
$default = isset($option['default']) ? $option['default'] : array();
|
918 |
+
$values = isset($option['value']) ? $option['value'] : $default;
|
919 |
|
920 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
921 |
|
922 |
+
$remove_text = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
|
923 |
+
$sortable = isset($option['sortable']) ? $option['sortable'] : true;
|
924 |
+
$allow_clone = isset($option['allow_clone']) ? $option['allow_clone'] : false;
|
925 |
|
|
|
926 |
|
927 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
928 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
|
|
|
|
929 |
|
|
|
|
|
930 |
|
931 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
932 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
933 |
|
934 |
+
if ($is_pro == true) {
|
935 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
936 |
+
}
|
937 |
|
938 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
939 |
|
|
|
|
|
940 |
|
941 |
+
ob_start();
|
942 |
+
?>
|
943 |
+
<div id="input-wrapper-<?php echo $id; ?>" class="input-wrapper input-text-multi-wrapper
|
944 |
+
input-text-multi-wrapper-<?php echo $css_id; ?>">
|
945 |
+
<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>
|
946 |
+
<div class="field-list <?php if ($sortable) {
|
947 |
+
echo 'sortable';
|
948 |
+
} ?>" id="<?php echo $css_id; ?>">
|
949 |
+
<?php
|
950 |
+
if (!empty($values)) :
|
951 |
+
foreach ($values as $value) :
|
952 |
+
?>
|
953 |
+
<div class="item">
|
954 |
+
<input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
|
955 |
+
echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
|
956 |
+
|
957 |
+
<?php if ($allow_clone) : ?>
|
958 |
+
<span class="button clone"><i class="far fa-clone"></i></span>
|
959 |
+
<?php endif; ?>
|
960 |
|
|
|
|
|
961 |
|
962 |
+
<?php if ($sortable) : ?>
|
963 |
+
<span class="button sort"><i class="fas fa-arrows-alt"></i></span>
|
964 |
+
<?php endif; ?>
|
965 |
|
966 |
+
<span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
|
967 |
+
</div>
|
968 |
+
<?php
|
969 |
+
endforeach;
|
970 |
|
971 |
+
else :
|
972 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
973 |
?>
|
974 |
<div class="item">
|
975 |
+
<input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
|
976 |
+
echo esc_attr($placeholder); ?>" value="" />
|
977 |
|
978 |
+
<?php if ($allow_clone) : ?>
|
979 |
<span class="button clone"><i class="far fa-clone"></i></span>
|
980 |
<?php endif; ?>
|
981 |
|
982 |
|
983 |
+
<?php if ($sortable) : ?>
|
984 |
<span class="button sort"><i class="fas fa-arrows-alt"></i></span>
|
985 |
<?php endif; ?>
|
986 |
|
987 |
<span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
|
988 |
</div>
|
989 |
<?php
|
|
|
|
|
|
|
990 |
|
991 |
+
endif;
|
992 |
?>
|
993 |
+
</div>
|
994 |
+
<div class="error-mgs"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
995 |
|
|
|
|
|
|
|
996 |
|
|
|
|
|
997 |
</div>
|
|
|
|
|
|
|
|
|
998 |
|
999 |
<?php
|
1000 |
|
1001 |
+
$input_html = ob_get_clean();
|
|
|
|
|
1002 |
|
1003 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1004 |
+
}
|
1005 |
|
1006 |
+
public function field_hidden($option)
|
1007 |
+
{
|
1008 |
|
1009 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1010 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1011 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1012 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1013 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1014 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1015 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1016 |
|
1017 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1018 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1019 |
|
1020 |
+
$value = !empty($value) ? $value : $default;
|
1021 |
|
1022 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1023 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1024 |
|
1025 |
+
if ($is_pro == true) {
|
1026 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
1027 |
+
}
|
1028 |
|
1029 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1030 |
|
1031 |
|
1032 |
+
ob_start();
|
1033 |
?>
|
1034 |
+
<input type="hidden" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo esc_attr($value); ?>" />
|
1035 |
<?php
|
1036 |
|
1037 |
+
$input_html = ob_get_clean();
|
|
|
|
|
1038 |
|
1039 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1040 |
+
}
|
1041 |
|
1042 |
|
1043 |
+
public function field_text($option)
|
1044 |
+
{
|
1045 |
|
1046 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1047 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1048 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1049 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1050 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1051 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1052 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1053 |
|
1054 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1055 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1056 |
|
1057 |
+
$value = !empty($value) ? $value : $default;
|
1058 |
|
1059 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1060 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1061 |
|
1062 |
+
if ($is_pro == true) {
|
1063 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
1064 |
+
}
|
1065 |
|
1066 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1067 |
|
1068 |
|
1069 |
+
ob_start();
|
1070 |
?>
|
1071 |
+
<input type="text" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo esc_attr($value); ?>" />
|
1072 |
<?php
|
1073 |
|
1074 |
+
$input_html = ob_get_clean();
|
1075 |
|
1076 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1077 |
+
}
|
|
|
1078 |
|
1079 |
|
1080 |
|
1081 |
+
public function field_wp_editor($option)
|
1082 |
+
{
|
1083 |
|
1084 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1085 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1086 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1087 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1088 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1089 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1090 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1091 |
|
1092 |
|
1093 |
|
1094 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1095 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1096 |
|
1097 |
+
$value = !empty($value) ? $value : $default;
|
1098 |
|
1099 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1100 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1101 |
|
1102 |
+
if ($is_pro == true) {
|
1103 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
1104 |
+
}
|
1105 |
|
1106 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1107 |
|
1108 |
+
$editor_settings = isset($option['editor_settings']) ? $option['editor_settings'] : array('textarea_name' => $field_name, 'teeny' => true, 'textarea_rows' => 15,);
|
1109 |
|
1110 |
+
ob_start();
|
1111 |
|
1112 |
?>
|
1113 |
+
<div id="field-wrapper-<?php echo $id; ?>" class="<?php if (!empty($depends)) echo 'dependency-field'; ?> field-wrapper field-wp_editor-wrapper
|
1114 |
field-wp_editor-wrapper-<?php echo $id; ?>">
|
1115 |
+
<?php
|
1116 |
+
wp_editor($value, $css_id, $editor_settings);
|
1117 |
+
?>
|
1118 |
+
<div class="error-mgs"></div>
|
1119 |
+
</div>
|
1120 |
|
1121 |
<?php
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
+
$input_html = ob_get_clean();
|
|
|
|
|
1127 |
|
1128 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1129 |
+
}
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 |
+
public function field_text_icon($option)
|
1137 |
+
{
|
1138 |
|
1139 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1140 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1141 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1142 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1143 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1144 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1145 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1146 |
|
1147 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1148 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1149 |
|
1150 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1151 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1152 |
|
1153 |
+
$option_value = empty($value) ? $default : $value;
|
1154 |
|
1155 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
+
ob_start();
|
1161 |
?>
|
1162 |
+
<div class="text-icon">
|
1163 |
+
<span class="icon"><?php echo $option_value; ?></span><input type="text" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($option_value); ?>" />
|
1164 |
+
</div>
|
1165 |
+
<style>
|
1166 |
+
.text-icon {}
|
1167 |
+
|
1168 |
+
.text-icon .icon {
|
1169 |
+
/* width: 30px; */
|
1170 |
+
background: #ddd;
|
1171 |
+
/* height: 28px; */
|
1172 |
+
display: inline-block;
|
1173 |
+
vertical-align: top;
|
1174 |
+
text-align: center;
|
1175 |
+
font-size: 14px;
|
1176 |
+
padding: 5px 10px;
|
1177 |
+
line-height: normal;
|
1178 |
+
}
|
1179 |
+
</style>
|
1180 |
+
<script>
|
1181 |
+
jQuery(document).ready(function($) {
|
1182 |
+
$(document).on("keyup", ".text-icon input", function() {
|
1183 |
+
val = $(this).val();
|
1184 |
+
if (val) {
|
1185 |
+
$(this).parent().children(".icon").html(val);
|
1186 |
+
}
|
1187 |
+
})
|
1188 |
})
|
1189 |
+
</script>
|
|
|
1190 |
<?php
|
1191 |
|
1192 |
+
$input_html = ob_get_clean();
|
1193 |
|
1194 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1195 |
+
}
|
|
|
1196 |
|
1197 |
|
1198 |
|
1199 |
+
public function field_range($option)
|
1200 |
+
{
|
1201 |
|
1202 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1203 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1204 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1205 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1206 |
|
1207 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1208 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1209 |
|
1210 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1211 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1212 |
+
$value = !empty($value) ? $value : $default;
|
1213 |
|
1214 |
+
$args = isset($option['args']) ? $option['args'] : "";
|
1215 |
|
1216 |
+
$min = isset($args['min']) ? $args['min'] : '';
|
1217 |
+
$max = isset($args['max']) ? $args['max'] : '';
|
1218 |
+
$step = isset($args['step']) ? $args['step'] : '';
|
1219 |
|
1220 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1221 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1222 |
|
1223 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1224 |
|
1225 |
|
1226 |
+
ob_start();
|
1227 |
?>
|
1228 |
+
<div class="range-input">
|
1229 |
+
<span class="range-value"><?php echo $value; ?></span><input type="range" min="<?php if ($min) echo $min; ?>" max="<?php if ($max) echo $max; ?>" step="<?php if ($step) echo $step; ?>" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
1230 |
+
</div>
|
1231 |
+
|
1232 |
+
<script>
|
1233 |
+
jQuery(document).ready(function($) {
|
1234 |
+
$(document).on("change", "#<?php echo $css_id; ?>", function() {
|
1235 |
+
val = $(this).val();
|
1236 |
+
if (val) {
|
1237 |
+
$(this).parent().children(".range-value").html(val);
|
1238 |
+
}
|
1239 |
+
})
|
1240 |
})
|
1241 |
+
</script>
|
1242 |
+
|
1243 |
+
<style>
|
1244 |
+
.range-input {}
|
1245 |
+
|
1246 |
+
.range-input .range-value {
|
1247 |
+
display: inline-block;
|
1248 |
+
vertical-align: top;
|
1249 |
+
margin: 0 0;
|
1250 |
+
padding: 4px 10px;
|
1251 |
+
background: #eee;
|
1252 |
+
}
|
1253 |
+
</style>
|
1254 |
<?php
|
1255 |
|
1256 |
+
$input_html = ob_get_clean();
|
1257 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1258 |
+
}
|
1259 |
|
1260 |
|
1261 |
|
1262 |
+
public function field_textarea($option)
|
1263 |
+
{
|
1264 |
|
1265 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1266 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1267 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1268 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1269 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1270 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1271 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1272 |
+
$value = !empty($value) ? $value : $default;
|
1273 |
|
1274 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1275 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1276 |
|
1277 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1278 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1279 |
|
1280 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1281 |
|
1282 |
+
if ($is_pro == true) {
|
1283 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
1284 |
+
}
|
1285 |
|
1286 |
|
1287 |
+
ob_start();
|
1288 |
?>
|
1289 |
+
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1290 |
<?php
|
1291 |
|
1292 |
+
$input_html = ob_get_clean();
|
1293 |
|
1294 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1295 |
+
}
|
|
|
1296 |
|
1297 |
|
1298 |
|
1299 |
+
public function field_textarea_editor($option)
|
1300 |
+
{
|
1301 |
|
1302 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1303 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1304 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1305 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1306 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1307 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1308 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1309 |
+
$value = !empty($value) ? $value : $default;
|
1310 |
|
1311 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1312 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1313 |
|
1314 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1315 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1316 |
|
1317 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1318 |
|
1319 |
+
if ($is_pro == true) {
|
1320 |
+
$details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
|
1321 |
+
}
|
1322 |
|
1323 |
|
1324 |
+
ob_start();
|
1325 |
?>
|
1326 |
+
<textarea editor_enabled="no" class="textarea-editor" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1327 |
<?php
|
1328 |
|
1329 |
+
$input_html = ob_get_clean();
|
|
|
|
|
1330 |
|
1331 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1332 |
+
}
|
1333 |
|
1334 |
|
1335 |
|
1336 |
+
public function field_scripts_js($option)
|
1337 |
+
{
|
1338 |
|
1339 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1340 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1341 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1342 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1343 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1344 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1345 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1346 |
+
$value = !empty($value) ? $value : $default;
|
1347 |
|
1348 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1349 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1350 |
|
1351 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1352 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1353 |
|
1354 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1355 |
|
1356 |
+
$settings = wp_enqueue_code_editor(array('type' => 'text/javascript'));
|
1357 |
+
$code_editor = wp_json_encode($settings);
|
1358 |
|
1359 |
|
1360 |
+
ob_start();
|
1361 |
?>
|
1362 |
+
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1363 |
|
1364 |
+
<script>
|
1365 |
+
jQuery(document).ready(function($) {
|
1366 |
+
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1367 |
+
})
|
1368 |
+
</script>
|
1369 |
<?php
|
1370 |
|
1371 |
+
$input_html = ob_get_clean();
|
|
|
|
|
|
|
|
|
1372 |
|
1373 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1374 |
+
}
|
1375 |
|
1376 |
|
1377 |
+
public function field_scripts_css($option)
|
1378 |
+
{
|
1379 |
|
1380 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1381 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1382 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1383 |
|
1384 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1385 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1386 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1387 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1388 |
+
$value = !empty($value) ? $value : $default;
|
1389 |
|
1390 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1391 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1392 |
|
1393 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1394 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1395 |
|
1396 |
+
$settings = wp_enqueue_code_editor(array('type' => 'text/css'));
|
1397 |
+
$code_editor = wp_json_encode($settings);
|
1398 |
|
1399 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1400 |
?>
|
1401 |
|
1402 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1403 |
|
1404 |
+
ob_start();
|
1405 |
+
?>
|
1406 |
+
<textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1407 |
+
<script>
|
1408 |
+
jQuery(document).ready(function($) {
|
1409 |
|
1410 |
+
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1411 |
|
1412 |
|
1413 |
+
})
|
1414 |
+
</script>
|
1415 |
<?php
|
1416 |
|
1417 |
+
$input_html = ob_get_clean();
|
|
|
|
|
1418 |
|
1419 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1420 |
+
}
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 |
+
public function field_checkbox($option)
|
1427 |
+
{
|
1428 |
|
1429 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1430 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1431 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1432 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1433 |
+
$for = isset($option['for']) ? $option['for'] : "";
|
1434 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
1435 |
|
1436 |
+
$style = isset($option['style']) ? $option['style'] : array();
|
1437 |
+
$style_inline = isset($style['inline']) ? $style['inline'] : true;
|
1438 |
|
1439 |
|
1440 |
+
$option_value = isset($option['value']) ? $option['value'] : '';
|
1441 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1442 |
+
$option_value = !empty($option_value) ? $option_value : $default;
|
1443 |
|
1444 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1445 |
|
1446 |
|
1447 |
|
1448 |
?>
|
1449 |
+
<div class="setting-field">
|
1450 |
+
<div class="field-lable"><?php if (!empty($title)) echo $title; ?></div>
|
1451 |
+
<div class="field-input">
|
1452 |
+
<?php
|
1453 |
|
1454 |
|
1455 |
|
1456 |
+
if (!empty($args))
|
1457 |
+
foreach ($args as $key => $value) :
|
1458 |
|
1459 |
|
1460 |
+
//$checked = ( $key == $option_value ) ? "checked" : "";
|
1461 |
+
$checked = in_array($key, $option_value) ? "checked" : "";
|
1462 |
|
1463 |
+
$for = !empty($for) ? $for . '-' . $id . "-" . $key : $id . "-" . $key;
|
1464 |
|
1465 |
|
1466 |
+
?>
|
1467 |
+
<label for='<?php echo $for; ?>'><input name='<?php echo $field_name; ?>[]' type='checkbox' id='<?php echo $for; ?>' value='<?php echo $key; ?>' <?php echo $checked; ?>><span><?php echo $value; ?></span></label>
|
1468 |
|
1469 |
<?php
|
1470 |
|
1471 |
+
if (!$style_inline) {
|
1472 |
+
?>
|
1473 |
<br>
|
1474 |
+
<?php
|
1475 |
+
}
|
1476 |
|
1477 |
+
endforeach;
|
1478 |
|
1479 |
+
?>
|
1480 |
+
<p class="description"><?php if (!empty($details)) echo $details; ?></p>
|
1481 |
+
</div>
|
1482 |
</div>
|
1483 |
+
<?php
|
|
|
|
|
|
|
|
|
1484 |
|
1485 |
|
1486 |
+
}
|
1487 |
|
|
|
1488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1489 |
|
1490 |
+
public function field_radio($option)
|
1491 |
+
{
|
1492 |
|
1493 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1494 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1495 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1496 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1497 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1498 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1499 |
+
$for = isset($option['for']) ? $option['for'] : "";
|
1500 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
1501 |
|
1502 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1503 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1504 |
|
1505 |
+
$option_value = isset($option['value']) ? $option['value'] : '';
|
1506 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1507 |
+
$option_value = !empty($option_value) ? $option_value : $default;
|
1508 |
|
1509 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1511 |
|
1512 |
+
ob_start();
|
|
|
1513 |
|
1514 |
+
if (!empty($args))
|
1515 |
+
foreach ($args as $key => $value) :
|
1516 |
+
$checked = ($key == $option_value) ? "checked" : "";
|
1517 |
+
$for = !empty($for) ? $for . '-' . $css_id . "-" . $key : $css_id . "-" . $key;
|
1518 |
+
?>
|
1519 |
+
<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>
|
1520 |
|
1521 |
+
<?php
|
1522 |
+
endforeach;
|
1523 |
|
1524 |
+
$input_html = ob_get_clean();
|
1525 |
|
1526 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1527 |
+
}
|
1528 |
|
1529 |
|
1530 |
|
1531 |
+
public function field_radio_image($option)
|
1532 |
+
{
|
1533 |
|
1534 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1535 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1536 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1537 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1538 |
+
$args = isset($option['args']) ? $option['args'] : array();
|
1539 |
+
//$args = is_array( $args ) ? $args : $this->generate_args_from_string( $args );
|
1540 |
+
$option_value = isset($option['value']) ? $option['value'] : '';
|
1541 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1542 |
+
$lazy_load_img = isset($option['lazy_load_img']) ? $option['lazy_load_img'] : '';
|
1543 |
|
1544 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1545 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1546 |
|
1547 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1548 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1549 |
+
$width = isset($option['width']) ? $option['width'] : "250px";
|
1550 |
|
1551 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1552 |
|
1553 |
+
//var_dump($option_value);
|
1554 |
|
1555 |
+
$option_value = empty($option_value) ? $default : $option_value;
|
1556 |
|
1557 |
|
1558 |
|
1559 |
+
ob_start();
|
1560 |
+
?>
|
1561 |
+
<div class="radio-img">
|
1562 |
+
<?php
|
1563 |
+
foreach ($args as $key => $value) :
|
1564 |
|
1565 |
+
$name = $value['name'];
|
1566 |
+
$thumb = $value['thumb'];
|
1567 |
+
$disabled = isset($value['disabled']) ? $value['disabled'] : '';
|
1568 |
+
$pro_msg = isset($value['pro_msg']) ? $value['pro_msg'] : '';
|
1569 |
+
$link = isset($value['link']) ? $value['link'] : '';
|
1570 |
+
$link_text = isset($value['link_text']) ? $value['link_text'] : 'Go';
|
1571 |
|
1572 |
+
$checked = ($key == $option_value) ? "checked" : "";
|
1573 |
|
1574 |
+
//var_dump($checked);
|
1575 |
|
1576 |
?>
|
1577 |
+
<label style="width: <?php echo $width; ?>;" title="<?php echo $name; ?>" class="<?php if ($checked == 'checked') echo 'active'; ?> <?php if ($disabled == true) echo 'disabled'; ?>">
|
1578 |
+
<input <?php if ($disabled) echo 'disabled'; ?> name="<?php echo $field_name; ?>" type="radio" id="<?php echo $css_id; ?>-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?>>
|
1579 |
|
1580 |
+
<?php
|
1581 |
+
if (!empty($thumb)) :
|
1582 |
|
1583 |
?>
|
1584 |
+
<img class="lazy" alt="<?php echo $name; ?>" data-src="<?php echo $thumb; ?>" src="<?php echo $lazy_load_img; ?>">
|
1585 |
+
<div style="padding: 5px;" class="name"><?php echo $name; ?></div>
|
1586 |
|
1587 |
<?php
|
1588 |
+
else :
|
1589 |
+
echo $name;
|
1590 |
+
endif;
|
1591 |
+
?>
|
1592 |
|
1593 |
+
<?php if ($disabled == true) : ?>
|
1594 |
+
<span class="pro-msg"><?php echo $pro_msg; ?></span>
|
1595 |
+
<?php endif; ?>
|
1596 |
+
<?php if (!empty($link)) : ?>
|
1597 |
+
<a target="_blank" class="link" href="<?php echo $link; ?>"><?php echo $link_text; ?></a>
|
1598 |
+
<?php endif; ?>
|
1599 |
|
1600 |
+
</label>
|
1601 |
+
<?php
|
1602 |
|
1603 |
+
endforeach;
|
1604 |
+
?>
|
1605 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1606 |
|
1607 |
+
<style>
|
1608 |
+
.radio-img {}
|
|
|
1609 |
|
1610 |
+
.radio-img label {
|
1611 |
+
display: inline-block;
|
1612 |
+
vertical-align: top;
|
1613 |
+
margin: 5px;
|
1614 |
+
padding: 2px;
|
1615 |
+
background: #eee;
|
1616 |
+
position: relative;
|
1617 |
+
}
|
1618 |
|
1619 |
+
.radio-img label.active {
|
1620 |
+
background: #fd730d;
|
1621 |
+
}
|
|
|
|
|
1622 |
|
1623 |
+
.radio-img label.disabled {
|
1624 |
+
background: #e2e2e2;
|
|
|
|
|
|
|
|
|
|
|
1625 |
|
1626 |
+
}
|
1627 |
|
1628 |
+
.radio-img label.disabled img {
|
1629 |
+
background: #e2e2e2;
|
1630 |
+
opacity: .3;
|
1631 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1632 |
|
1633 |
+
.radio-img label.disabled .pro-msg {
|
1634 |
+
background: #ffd87f;
|
1635 |
+
position: absolute;
|
1636 |
+
top: 50%;
|
1637 |
+
left: 50%;
|
1638 |
+
transform: translate(-50%, -50%);
|
1639 |
+
padding: 0 10px;
|
1640 |
|
1641 |
+
}
|
1642 |
|
1643 |
+
.radio-img label .link {
|
1644 |
+
background: hsl(200, 7%, 42%);
|
1645 |
+
position: absolute;
|
1646 |
+
top: 2px;
|
1647 |
+
/* transform: translate(0%,-50%); */
|
1648 |
+
padding: 3px 14px;
|
1649 |
+
text-decoration: none;
|
1650 |
+
font-size: 14px;
|
1651 |
+
color: #fff;
|
1652 |
+
right: 2px;
|
1653 |
|
1654 |
+
}
|
|
|
|
|
1655 |
|
|
|
|
|
1656 |
|
1657 |
+
.radio-img input[type=radio] {
|
1658 |
+
display: none;
|
1659 |
+
}
|
1660 |
+
|
1661 |
+
.radio-img img {
|
1662 |
|
1663 |
+
vertical-align: top;
|
1664 |
+
width: 100%;
|
1665 |
+
}
|
1666 |
+
</style>
|
1667 |
+
<?php
|
1668 |
|
1669 |
+
$input_html = ob_get_clean();
|
1670 |
|
1671 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1672 |
+
}
|
1673 |
|
1674 |
+
public function field_datepicker($option)
|
1675 |
+
{
|
1676 |
|
1677 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1678 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1679 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1680 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1681 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1682 |
+
$format = isset($option['format']) ? $option['format'] : "";
|
1683 |
|
1684 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1685 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1686 |
|
1687 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1688 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1689 |
+
$value = !empty($value) ? $value : $default;
|
1690 |
|
1691 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1692 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1693 |
|
1694 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1695 |
|
1696 |
|
1697 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
1698 |
+
wp_enqueue_style('jquery-ui');
|
1699 |
|
1700 |
+
ob_start();
|
1701 |
?>
|
1702 |
+
<input type="text" autocomplete="off" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo $value; ?>" />
|
1703 |
+
<script>
|
1704 |
+
jQuery(document).ready(function($) {
|
1705 |
+
$("#<?php echo $css_id; ?>").datepicker({
|
1706 |
+
dateFormat: "<?php echo $format; ?>"
|
1707 |
+
});
|
1708 |
+
});
|
1709 |
+
</script>
|
1710 |
<?php
|
1711 |
|
1712 |
+
$input_html = ob_get_clean();
|
1713 |
|
1714 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1715 |
+
}
|
1716 |
|
1717 |
|
1718 |
|
1719 |
+
public function field_colorpicker($option)
|
1720 |
+
{
|
1721 |
|
1722 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1723 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1724 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1725 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1726 |
+
$placeholder = isset($option['placeholder']) ? $option['placeholder'] : "";
|
1727 |
|
1728 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1729 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1730 |
|
1731 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1732 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1733 |
+
$value = !empty($value) ? $value : $default;
|
1734 |
|
1735 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1736 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1737 |
|
1738 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1739 |
|
1740 |
+
ob_start();
|
1741 |
?>
|
1742 |
+
<input colorPicker="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
|
1743 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1744 |
|
1745 |
+
$input_html = ob_get_clean();
|
|
|
1746 |
|
1747 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1748 |
+
}
|
|
|
1749 |
|
|
|
|
|
1750 |
|
1751 |
+
public function field_colorpicker_multi($option)
|
1752 |
+
{
|
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 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1762 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1763 |
|
1764 |
+
$value = isset($option['value']) ? $option['value'] : '';
|
1765 |
+
$default = isset($option['default']) ? $option['default'] : '';
|
1766 |
+
$value = !empty($value) ? $value : $default;
|
1767 |
|
1768 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1769 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1770 |
|
1771 |
+
$field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
|
1772 |
|
|
|
1773 |
|
1774 |
|
1775 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
|
|
|
|
|
|
|
|
|
|
1776 |
|
1777 |
+
ob_start();
|
|
|
1778 |
|
1779 |
+
if (!empty($args)) :
|
1780 |
|
1781 |
+
foreach ($args as $arg_key => $arg) :
|
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>
|
1791 |
+
jQuery(document).ready(function($) {
|
1792 |
+
$("#<?php echo $arg_key . '-' . $css_id; ?>").wpColorPicker();
|
1793 |
+
});
|
1794 |
+
</script>
|
1795 |
+
</div>
|
1796 |
|
1797 |
+
<?php
|
1798 |
+
endforeach;
|
1799 |
|
1800 |
+
endif;
|
|
|
|
|
|
|
|
|
1801 |
|
|
|
|
|
1802 |
|
1803 |
+
$input_html = ob_get_clean();
|
|
|
1804 |
|
1805 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1806 |
+
}
|
1807 |
|
|
|
1808 |
|
1809 |
|
1810 |
+
public function field_custom_html($option)
|
1811 |
+
{
|
1812 |
|
1813 |
+
$id = isset($option['id']) ? $option['id'] : "";
|
1814 |
+
$css_id = isset($option['css_id']) ? $option['css_id'] : $id;
|
1815 |
+
$parent = isset($option['parent']) ? $option['parent'] : "";
|
1816 |
+
$field_template = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
|
1817 |
+
$html = isset($option['html']) ? $option['html'] : "";
|
1818 |
|
1819 |
+
$is_pro = isset($option['is_pro']) ? $option['is_pro'] : false;
|
1820 |
+
$pro_text = isset($option['pro_text']) ? $option['pro_text'] : '';
|
1821 |
|
1822 |
+
$title = isset($option['title']) ? $option['title'] : "";
|
1823 |
+
$details = isset($option['details']) ? $option['details'] : "";
|
1824 |
|
1825 |
|
1826 |
+
echo sprintf($field_template, $title, $html, $details);
|
1827 |
+
}
|
1828 |
}
|
1829 |
+
}
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Donate link: https://www.pickplugins.com/item/woocommerce-products-slider-for-wordpress/?ref=wordpress.org
|
4 |
Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
|
5 |
Requires at least: 3.8
|
6 |
-
Tested up to: 6.
|
7 |
-
Stable tag: 1.13.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -141,6 +141,10 @@ then paste this shortcode anywhere in your page to display slider<br />
|
|
141 |
|
142 |
== Changelog ==
|
143 |
|
|
|
|
|
|
|
|
|
144 |
= 1.13.37 =
|
145 |
* 2022-08-10 fix - Scripts file loading issue fixed.
|
146 |
|
3 |
Donate link: https://www.pickplugins.com/item/woocommerce-products-slider-for-wordpress/?ref=wordpress.org
|
4 |
Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
|
5 |
Requires at least: 3.8
|
6 |
+
Tested up to: 6.1
|
7 |
+
Stable tag: 1.13.38
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
141 |
|
142 |
== Changelog ==
|
143 |
|
144 |
+
|
145 |
+
= 1.13.38 =
|
146 |
+
* 2022-09-26 fix - jQuery UI tabs missing issue fixed.
|
147 |
+
|
148 |
= 1.13.37 =
|
149 |
* 2022-08-10 fix - Scripts file loading issue fixed.
|
150 |
|
woocommerce-products-slider.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
-
Version: 1.13.
|
7 |
WC requires at least: 3.0.0
|
8 |
-
WC tested up to:
|
9 |
Author: PickPlugins
|
10 |
Text Domain: woocommerce-products-slider
|
11 |
Author URI: http://pickplugins.com
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
+
Version: 1.13.38
|
7 |
WC requires at least: 3.0.0
|
8 |
+
WC tested up to: 7.1
|
9 |
Author: PickPlugins
|
10 |
Text Domain: woocommerce-products-slider
|
11 |
Author URI: http://pickplugins.com
|