Ultimate Member – User Profile & Membership Plugin - Version 2.1.2

Version Description

Download this release

Release Info

Developer nsinelnikov
Plugin Icon 128x128 Ultimate Member – User Profile & Membership Plugin
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

Files changed (50) hide show
  1. assets/css/pickadate/default.css +4 -0
  2. assets/css/pickadate/default.time.css +5 -0
  3. assets/css/um-members-rtl.css +2 -2
  4. assets/css/um-members.css +28 -6
  5. assets/css/um-old-default.css +5 -0
  6. assets/css/um-styles.css +2 -4
  7. assets/js/um-members.js +234 -32
  8. assets/js/um-members.min.js +1 -1
  9. assets/js/um-scripts.js +62 -19
  10. assets/js/um-scripts.min.js +1 -1
  11. includes/admin/assets/css/um-admin-builder.css +14 -0
  12. includes/admin/assets/css/um-admin-forms.css +28 -1
  13. includes/admin/assets/js/um-admin-forms.js +28 -8
  14. includes/admin/assets/js/um-admin-modal.js +5 -0
  15. includes/admin/assets/js/um-admin-settings.js +1 -1
  16. includes/admin/core/class-admin-builder.php +21 -1
  17. includes/admin/core/class-admin-enqueue.php +2 -21
  18. includes/admin/core/class-admin-forms.php +19 -3
  19. includes/admin/core/class-admin-notices.php +6 -2
  20. includes/admin/core/list-tables/emails-list-table.php +1 -1
  21. includes/admin/core/packages/2.1.0-beta1/member-directory.php +3 -0
  22. includes/admin/templates/directory/pagination.php +17 -15
  23. includes/admin/templates/directory/profile.php +6 -3
  24. includes/admin/templates/directory/search.php +10 -1
  25. includes/class-config.php +1 -0
  26. includes/class-init.php +3 -2
  27. includes/core/class-account.php +1 -0
  28. includes/core/class-builtin.php +1 -0
  29. includes/core/class-enqueue.php +1 -1
  30. includes/core/class-external-integrations.php +3 -0
  31. includes/core/class-fields.php +254 -167
  32. includes/core/class-form.php +19 -2
  33. includes/core/class-member-directory.php +221 -66
  34. includes/core/class-plugin-updater.php +25 -2
  35. includes/core/class-shortcodes.php +4 -0
  36. includes/core/class-user.php +6 -3
  37. includes/core/um-actions-account.php +13 -16
  38. includes/core/um-actions-form.php +43 -6
  39. includes/core/um-actions-login.php +0 -5
  40. includes/core/um-actions-profile.php +54 -26
  41. includes/core/um-actions-register.php +0 -3
  42. includes/core/um-actions-wpadmin.php +4 -2
  43. includes/um-short-functions.php +57 -35
  44. languages/ultimate-member-en_US.mo +0 -0
  45. languages/ultimate-member-en_US.po +762 -744
  46. readme.txt +31 -1
  47. templates/members-grid.php +4 -2
  48. templates/members-list.php +15 -16
  49. templates/members.php +7 -3
  50. ultimate-member.php +1 -1
assets/css/pickadate/default.css CHANGED
@@ -17,6 +17,10 @@
17
user-select: none;
18
}
19
20
/**
21
* The picker input element.
22
*/
17
user-select: none;
18
}
19
20
+ .um .picker__box ul li[role="presentation"] {
21
+ margin: 10px 0 0 0;
22
+ }
23
+
24
/**
25
* The picker input element.
26
*/
assets/css/pickadate/default.time.css CHANGED
@@ -101,6 +101,11 @@
101
padding: 0;
102
border-radius: 2px !important;
103
}
104
@media (min-height: 40.125em) {
105
.um .picker--time .picker__frame {
106
margin-bottom: 10% !important;
101
padding: 0;
102
border-radius: 2px !important;
103
}
104
+
105
+ .um .picker__box ul li[role="presentation"] {
106
+ margin: 10px 0 0 0;
107
+ }
108
+
109
@media (min-height: 40.125em) {
110
.um .picker--time .picker__frame {
111
margin-bottom: 10% !important;
assets/css/um-members-rtl.css CHANGED
@@ -15,9 +15,9 @@
15
margin: 0 0 0 5px; }
16
17
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input, .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input {
18
- margin: 0 0 0 5px; }
19
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input:nth-child(even), .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input:nth-child(even) {
20
- margin: 0 5px 0 0; }
21
22
.um-directory .um-member-directory-header .um-member-directory-header-row .um-filtered-line .um-members-filter-tag {
23
margin: 0 0 5px 10px; }
15
margin: 0 0 0 5px; }
16
17
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input, .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input {
18
+ margin: 0 0 0 5px !important; }
19
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input:nth-child(even), .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input:nth-child(even) {
20
+ margin: 0 5px 0 0 !important; }
21
22
.um-directory .um-member-directory-header .um-member-directory-header-row .um-filtered-line .um-members-filter-tag {
23
margin: 0 0 5px 10px; }
assets/css/um-members.css CHANGED
@@ -107,7 +107,7 @@ body #content .um-directory a {
107
width: 100%;
108
top: 0;
109
bottom: 0;
110
- background: rgba(255, 255, 255, 0.8);
111
z-index: 2; }
112
.um-directory .um-members-overlay .um-ajax-loading {
113
-webkit-transition: 0.1s opacity;
@@ -144,6 +144,8 @@ body #content .um-directory a {
144
align-items: stretch;
145
flex-wrap: nowrap;
146
width: 100%; }
147
.um-directory .um-member-directory-header .um-member-directory-header-row:not(.um-member-directory-filters-bar) {
148
display: flex;
149
flex-direction: row;
@@ -172,9 +174,13 @@ body #content .um-directory a {
172
margin: 0 5px 0 0; }
173
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line label .um-search-line {
174
-webkit-appearance: textfield;
175
- width: 100%; }
176
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line .um-do-search {
177
- min-width: 15%; }
178
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line {
179
display: flex;
180
flex-direction: row;
@@ -279,6 +285,8 @@ body #content .um-directory a {
279
width: 100% !important; }
280
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter .um-s1 {
281
width: 100%; }
282
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-slider-filter-type {
283
flex-direction: column;
284
align-items: stretch; }
@@ -308,12 +316,12 @@ body #content .um-directory a {
308
flex-wrap: nowrap; }
309
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input, .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input {
310
width: calc( 50% - 5px);
311
- margin: 0 5px 0 0;
312
box-sizing: border-box;
313
-moz-box-sizing: border-box;
314
-webkit-box-sizing: border-box; }
315
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input:nth-child(even), .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input:nth-child(even) {
316
- margin: 0 0 0 5px; }
317
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search[style*="overflow: hidden;"] .um-search-filter {
318
pointer-events: none; }
319
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search.um-search-invisible {
@@ -595,7 +603,7 @@ body #content .um-directory a {
595
width: 100%;
596
padding: 15px;
597
margin: 0;
598
- background: none;
599
box-sizing: border-box;
600
-moz-box-sizing: border-box;
601
-webkit-box-sizing: border-box; }
@@ -651,6 +659,8 @@ body #content .um-directory a {
651
box-sizing: border-box;
652
-moz-box-sizing: border-box;
653
-webkit-box-sizing: border-box; }
654
.um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-container .um-member-card .um-member-card-content {
655
display: flex;
656
flex-direction: column;
@@ -803,6 +813,12 @@ body #content .um-directory a {
803
font-size: 28px;
804
height: 28px;
805
line-height: 28px; }
806
.um-directory .um-members-wrapper .um-members .um-members-none {
807
text-align: center;
808
font-size: 18px; }
@@ -918,6 +934,8 @@ body #content .um-directory a {
918
margin: 0 0 5px 0; }
919
.um-directory.uimob340 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper a.um-button {
920
width: 100% !important; }
921
.um-directory.uimob340 .um-members-pagination-box .um-members-pagi {
922
display: none; }
923
.um-directory.uimob500 .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line {
@@ -954,6 +972,8 @@ body #content .um-directory a {
954
margin: 0 10px 0 0; }
955
.um-directory.uimob500 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper {
956
margin: 0 10px 5px 0; }
957
.um-directory.uimob500 .um-members-pagination-box .um-members-pagi {
958
display: none; }
959
.um-directory.uimob800 .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line {
@@ -983,6 +1003,8 @@ body #content .um-directory a {
983
margin: 0 10px 0 0; }
984
.um-directory.uimob800 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper {
985
margin: 0 10px 5px 0; }
986
.um-directory.uimob960 .um-member-directory-header .um-search {
987
grid-template-columns: repeat(2, 1fr); }
988
.um-directory.uimob960 .um-members-wrapper .um-members.um-members-grid .um-gutter-sizer {
107
width: 100%;
108
top: 0;
109
bottom: 0;
110
+ background: none;
111
z-index: 2; }
112
.um-directory .um-members-overlay .um-ajax-loading {
113
-webkit-transition: 0.1s opacity;
144
align-items: stretch;
145
flex-wrap: nowrap;
146
width: 100%; }
147
+ .um-directory .um-member-directory-header .um-member-directory-header-row.um-member-directory-filters-bar {
148
+ padding: 0 0 10px 0; }
149
.um-directory .um-member-directory-header .um-member-directory-header-row:not(.um-member-directory-filters-bar) {
150
display: flex;
151
flex-direction: row;
174
margin: 0 5px 0 0; }
175
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line label .um-search-line {
176
-webkit-appearance: textfield;
177
+ width: 100%;
178
+ box-sizing: border-box;
179
+ -moz-box-sizing: border-box;
180
+ -webkit-box-sizing: border-box; }
181
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line .um-do-search {
182
+ min-width: 15%;
183
+ width: auto; }
184
.um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line {
185
display: flex;
186
flex-direction: row;
285
width: 100% !important; }
286
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter .um-s1 {
287
width: 100%; }
288
+ .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-text-filter-type input {
289
+ width: 100%; }
290
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-slider-filter-type {
291
flex-direction: column;
292
align-items: stretch; }
316
flex-wrap: nowrap; }
317
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input, .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input {
318
width: calc( 50% - 5px);
319
+ margin: 0 5px 0 0 !important;
320
box-sizing: border-box;
321
-moz-box-sizing: border-box;
322
-webkit-box-sizing: border-box; }
323
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-datepicker-filter-type input:nth-child(even), .um-directory .um-member-directory-header .um-member-directory-header-row .um-search .um-search-filter.um-timepicker-filter-type input:nth-child(even) {
324
+ margin: 0 0 0 5px !important; }
325
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search[style*="overflow: hidden;"] .um-search-filter {
326
pointer-events: none; }
327
.um-directory .um-member-directory-header .um-member-directory-header-row .um-search.um-search-invisible {
603
width: 100%;
604
padding: 15px;
605
margin: 0;
606
+ background: #fff;
607
box-sizing: border-box;
608
-moz-box-sizing: border-box;
609
-webkit-box-sizing: border-box; }
659
box-sizing: border-box;
660
-moz-box-sizing: border-box;
661
-webkit-box-sizing: border-box; }
662
+ .um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-container .um-member-card.no-photo {
663
+ width: 100%; }
664
.um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-container .um-member-card .um-member-card-content {
665
display: flex;
666
flex-direction: column;
813
font-size: 28px;
814
height: 28px;
815
line-height: 28px; }
816
+ .um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-photo.no-reveal .um-member-card-footer-buttons {
817
+ width: 100%; }
818
+ .um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-photo:not(.no-reveal) .um-member-card-footer-buttons {
819
+ width: calc( 100% - 30px); }
820
+ .um-directory .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-reveal:not(.no-photo) .um-member-card-footer-buttons {
821
+ width: calc( 100% - 125px); }
822
.um-directory .um-members-wrapper .um-members .um-members-none {
823
text-align: center;
824
font-size: 18px; }
934
margin: 0 0 5px 0; }
935
.um-directory.uimob340 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper a.um-button {
936
width: 100% !important; }
937
+ .um-directory.uimob340 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-reveal:not(.no-photo) .um-member-card-footer-buttons {
938
+ width: calc( 100% - 70px); }
939
.um-directory.uimob340 .um-members-pagination-box .um-members-pagi {
940
display: none; }
941
.um-directory.uimob500 .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line {
972
margin: 0 10px 0 0; }
973
.um-directory.uimob500 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper {
974
margin: 0 10px 5px 0; }
975
+ .um-directory.uimob500 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-reveal:not(.no-photo) .um-member-card-footer-buttons {
976
+ width: calc( 100% - 90px); }
977
.um-directory.uimob500 .um-members-pagination-box .um-members-pagi {
978
display: none; }
979
.um-directory.uimob800 .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line {
1003
margin: 0 10px 0 0; }
1004
.um-directory.uimob800 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer .um-member-card-footer-buttons .um-members-list-footer-button-wrapper {
1005
margin: 0 10px 5px 0; }
1006
+ .um-directory.uimob800 .um-members-wrapper .um-members.um-members-list .um-member .um-member-card-footer.no-reveal:not(.no-photo) .um-member-card-footer-buttons {
1007
+ width: calc( 100% - 100px); }
1008
.um-directory.uimob960 .um-member-directory-header .um-search {
1009
grid-template-columns: repeat(2, 1fr); }
1010
.um-directory.uimob960 .um-members-wrapper .um-members.um-members-grid .um-gutter-sizer {
assets/css/um-old-default.css CHANGED
@@ -126,6 +126,7 @@ div.uimob800 .um-account-side li a.current:hover
126
}
127
128
.um .um-form input[type=text],
129
.um .um-form input[type=tel],
130
.um .um-form input[type=number],
131
.um .um-form input[type=password],
@@ -145,6 +146,7 @@ div.uimob800 .um-account-side li a.current:hover
145
}
146
147
.um .um-form input[type=text]:focus,
148
.um .um-form input[type=tel]:focus,
149
.um .um-form input[type=number]:focus,
150
.um .um-form input[type=password]:focus,
@@ -155,6 +157,7 @@ div.uimob800 .um-account-side li a.current:hover
155
}
156
157
.um .um-form input[type=text],
158
.um .um-form input[type=tel],
159
.um .um-form input[type=number],
160
.um .um-form input[type=password],
@@ -166,6 +169,7 @@ div.uimob800 .um-account-side li a.current:hover
166
}
167
168
.um .um-form input[type=text]:focus,
169
.um .um-form input[type=tel]:focus,
170
.um .um-form input[type=number]:focus,
171
.um .um-form input[type=password]:focus,
@@ -174,6 +178,7 @@ div.uimob800 .um-account-side li a.current:hover
174
}
175
176
.um .um-form input[type=text],
177
.um .um-form input[type=tel],
178
.um .um-form input[type=password],
179
.um .um-form textarea
126
}
127
128
.um .um-form input[type=text],
129
+ .um .um-form input[type=search],
130
.um .um-form input[type=tel],
131
.um .um-form input[type=number],
132
.um .um-form input[type=password],
146
}
147
148
.um .um-form input[type=text]:focus,
149
+ .um .um-form input[type=search]:focus,
150
.um .um-form input[type=tel]:focus,
151
.um .um-form input[type=number]:focus,
152
.um .um-form input[type=password]:focus,
157
}
158
159
.um .um-form input[type=text],
160
+ .um .um-form input[type=search],
161
.um .um-form input[type=tel],
162
.um .um-form input[type=number],
163
.um .um-form input[type=password],
169
}
170
171
.um .um-form input[type=text]:focus,
172
+ .um .um-form input[type=search]:focus,
173
.um .um-form input[type=tel]:focus,
174
.um .um-form input[type=number]:focus,
175
.um .um-form input[type=password]:focus,
178
}
179
180
.um .um-form input[type=text],
181
+ .um .um-form input[type=search],
182
.um .um-form input[type=tel],
183
.um .um-form input[type=password],
184
.um .um-form textarea
assets/css/um-styles.css CHANGED
@@ -347,10 +347,6 @@ p.um-notice.warning a {
347
font-size: 17px;
348
}
349
350
- .um-field-shortcode {
351
-
352
- }
353
-
354
.um-field-spacing {
355
width: 100%;
356
}
@@ -391,6 +387,7 @@ p.um-notice.warning a {
391
}
392
393
.um-form input[type=text],
394
.um-form input[type=tel],
395
.um-form input[type=number],
396
.um-form input[type=password] {
@@ -418,6 +415,7 @@ p.um-notice.warning a {
418
}
419
420
.um-form input[type=text]:focus,
421
.um-form input[type=tel]:focus,
422
.um-form input[type=number]:focus,
423
.um-form input[type=password]:focus,
347
font-size: 17px;
348
}
349
350
.um-field-spacing {
351
width: 100%;
352
}
387
}
388
389
.um-form input[type=text],
390
+ .um-form input[type=search],
391
.um-form input[type=tel],
392
.um-form input[type=number],
393
.um-form input[type=password] {
415
}
416
417
.um-form input[type=text]:focus,
418
+ .um-form input[type=search]:focus,
419
.um-form input[type=tel]:focus,
420
.um-form input[type=number]:focus,
421
.um-form input[type=password]:focus,
assets/js/um-members.js CHANGED
@@ -34,7 +34,8 @@ function um_get_data_for_directory( directory, search_key ) {
34
} else {
35
if ( typeof data[ search_key ] !== 'undefined' ) {
36
try {
37
- data[ search_key ] = decodeURI( data[ search_key ] );
38
} catch(e) { // catches a malformed URI
39
console.error(e);
40
}
@@ -52,6 +53,20 @@ function um_set_url_from_data( directory, key, value ) {
52
var other_directories = um_member_directories;
53
54
var new_data = {};
55
if ( value !== '' ) {
56
new_data[ key + '_' + hash ] = value;
57
}
@@ -86,7 +101,6 @@ function um_set_url_from_data( directory, key, value ) {
86
query_strings = wp.hooks.applyFilters( 'um_member_directory_url_attrs', query_strings );
87
88
var query_string = '?' + query_strings.join( '&' );
89
-
90
if ( query_string === '?' ) {
91
query_string = '';
92
}
@@ -158,6 +172,25 @@ function um_get_current_page( directory ) {
158
return page;
159
}
160
161
162
function um_ajax_get_members( directory, args ) {
163
@@ -213,15 +246,52 @@ function um_ajax_get_members( directory, args ) {
213
var filter_name = filter.find( '.um-timepicker-filter' ).data('filter_name');
214
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
215
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
216
- if ( typeof value_from != 'undefined' || typeof value_to != 'undefined' ) {
217
request[ filter_name ] = [ value_from, value_to ];
218
}
219
- } else {
220
var filter_name = filter.find('select').attr('name');
221
var value = um_get_data_for_directory( directory, 'filter_' + filter_name );
222
if ( typeof value != 'undefined' ) {
223
request[ filter_name ] = value.split( '||' );
224
}
225
}
226
});
227
}
@@ -267,14 +337,16 @@ function um_ajax_get_members( directory, args ) {
267
268
function um_build_template( directory, data ) {
269
var layout = directory.data('view_type');
270
- var template = wp.template( 'um-member-' + layout );
271
272
directory.find('.um-members-grid, .um-members-list').remove();
273
directory.find('.um-members-wrapper').prepend( template( data.users ) );
274
275
var header_template = wp.template( 'um-members-header' );
276
directory.find('.um-members-intro').remove();
277
- directory.find('.um-members-wrapper').prepend( header_template( data ) );
278
279
directory.addClass('um-loaded');
280
@@ -402,6 +474,21 @@ function um_get_filters_data( directory ) {
402
filters_data.push( {'name':filter_name, 'label':filter_title, 'value_label':filter_value_title, 'value':filter_value[ i ], 'type':filter_type} );
403
});
404
405
} else if( filter.find('div.ui-slider').length ) {
406
filter_type = 'slider';
407
@@ -433,7 +520,7 @@ function um_change_tag( directory ) {
433
directory.find('.um-members-filter-tag').remove();
434
435
var filtered_line = directory.find('.um-filtered-line');
436
- if ( filtered_line.length ){
437
var filters_template = wp.template( 'um-members-filtered-line' );
438
filtered_line.prepend( filters_template( {'filters': filters_data} ) );
439
@@ -862,23 +949,107 @@ jQuery(document.body).ready( function() {
862
directory.data( 'searched', 1 );
863
directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
864
directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
865
});
866
867
868
- jQuery( document.body ).on( 'click', '.um-directory .um-members-filter-remove', function() {
869
var directory = jQuery(this).parents('.um-directory');
870
871
- if ( um_is_directory_busy( directory ) || ! directory ) {
872
return;
873
}
874
875
um_members_show_preloader( directory );
876
877
var removeItem = jQuery(this).data('value');
878
var filter_name = jQuery(this).data('name');
879
880
var type = jQuery(this).data('type');
881
- if ( type === 'select' ) {
882
883
var current_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
884
if ( typeof current_value == 'undefined' ) {
@@ -899,7 +1070,6 @@ jQuery(document.body).ready( function() {
899
900
um_set_url_from_data( directory, 'filter_' + filter_name, current_value );
901
902
-
903
var select = jQuery( '.um-search-filter select[name="' + filter_name + '"]' );
904
select.find('option[value="' + removeItem + '"]').prop('disabled', false).show();
905
@@ -909,6 +1079,10 @@ jQuery(document.body).ready( function() {
909
}
910
select.select2('destroy').select2();
911
912
} else if ( type === 'slider' ) {
913
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
914
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
@@ -967,7 +1141,12 @@ jQuery(document.body).ready( function() {
967
var filter_name = jQuery(this).data('name');
968
969
var type = jQuery(this).data('type');
970
- if ( type === 'select' ) {
971
972
var current_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
973
if ( typeof current_value == 'undefined' ) {
@@ -1000,12 +1179,21 @@ jQuery(document.body).ready( function() {
1000
} else if ( type === 'slider' ) {
1001
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1002
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1003
} else if ( type === 'datepicker' ) {
1004
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1005
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1006
} else if ( type === 'timepicker' ) {
1007
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1008
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1009
}
1010
});
1011
@@ -1054,18 +1242,7 @@ jQuery(document.body).ready( function() {
1054
var hash = um_members_get_hash( directory );
1055
um_member_directories.push( hash );
1056
1057
- var show_after_search = directory.data('must-search');
1058
- if ( show_after_search === 1 ) {
1059
- var search = um_get_search( directory );
1060
- var filters_data = um_get_filters_data( directory );
1061
- if ( ! filters_data.length && ! search ) {
1062
- return;
1063
- }
1064
- }
1065
-
1066
- um_members_show_preloader( directory );
1067
- um_ajax_get_members( directory, {first_load:true} );
1068
-
1069
if ( directory.find('.um-search').length ) {
1070
if ( ! directory.find('.um-search').is(':visible') ) {
1071
directory.find('.um-search').css({
@@ -1210,11 +1387,13 @@ jQuery(document.body).ready( function() {
1210
//timepicker filter
1211
directory.find('.um-timepicker-filter').each( function() {
1212
var elem = jQuery(this);
1213
1214
//using arrays formatted as [HOUR,MINUTE]
1215
1216
- var min = elem.data('min');
1217
- var max = elem.data('max');
1218
var picker_min = min.split(':');
1219
var picker_max = max.split(':');
1220
@@ -1228,6 +1407,7 @@ jQuery(document.body).ready( function() {
1228
onOpen: function() { elem.blur(); },
1229
onClose: function() { elem.blur(); },
1230
onSet: function( context ) {
1231
var directory = elem.parents('.um-directory');
1232
1233
if ( um_is_directory_busy( directory ) ) {
@@ -1249,13 +1429,14 @@ jQuery(document.body).ready( function() {
1249
}
1250
1251
if ( typeof context.select !== 'undefined' ) {
1252
- var select_val = context.select / 60;
1253
- var change_val = elem.val();
1254
1255
if ( range === 'from' ) {
1256
- current_value_from = select_val + ':00';
1257
} else if ( range === 'to' ) {
1258
- current_value_to = select_val + ':00';
1259
}
1260
} else {
1261
if ( range === 'from' ) {
@@ -1265,6 +1446,14 @@ jQuery(document.body).ready( function() {
1265
}
1266
}
1267
1268
um_set_url_from_data( directory, 'filter_' + filter_name + '_from', current_value_from );
1269
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', current_value_to );
1270
@@ -1279,10 +1468,11 @@ jQuery(document.body).ready( function() {
1279
directory.data( 'searched', 1 );
1280
directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
1281
directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
1282
}
1283
});
1284
1285
-
1286
var $picker = $input.pickatime('picker');
1287
var $fname = elem.data('filter_name');
1288
var $frange = elem.data('range');
@@ -1291,10 +1481,22 @@ jQuery(document.body).ready( function() {
1291
var query_value = um_get_data_for_directory( $directory, 'filter_' + $fname + '_' + $frange );
1292
if ( typeof query_value !== 'undefined' ) {
1293
var arr = query_value.split(':');
1294
- $picker.set( 'select', arr[0]*60 );
1295
}
1296
});
1297
1298
um_change_tag( directory );
1299
});
1300
34
} else {
35
if ( typeof data[ search_key ] !== 'undefined' ) {
36
try {
37
+ //data[ search_key ] = decodeURI( data[ search_key ] );
38
+ data[ search_key ] = decodeURIComponent( data[ search_key ] );
39
} catch(e) { // catches a malformed URI
40
console.error(e);
41
}
53
var other_directories = um_member_directories;
54
55
var new_data = {};
56
+
57
+ if ( jQuery.isArray( value ) ) {
58
+ jQuery.each( value, function( i ) {
59
+ value[ i ] = encodeURIComponent( value[ i ] );
60
+ });
61
+ value = value.join( '||' );
62
+ } else if ( ! jQuery.isNumeric( value ) ) {
63
+ value = value.split( '||' );
64
+ jQuery.each( value, function( i ) {
65
+ value[ i ] = encodeURIComponent( value[ i ] );
66
+ });
67
+ value = value.join( '||' );
68
+ }
69
+
70
if ( value !== '' ) {
71
new_data[ key + '_' + hash ] = value;
72
}
101
query_strings = wp.hooks.applyFilters( 'um_member_directory_url_attrs', query_strings );
102
103
var query_string = '?' + query_strings.join( '&' );
104
if ( query_string === '?' ) {
105
query_string = '';
106
}
172
return page;
173
}
174
175
+ function um_time_convert( time, range ) {
176
+ var hours = Math.floor( time / 60 );
177
+ var minutes = time % 60;
178
+
179
+ if ( minutes >= 60 ) {
180
+ minutes = 0;
181
+ hours = hours + 1;
182
+
183
+ if ( hours >= 24 ) {
184
+ hours = 0;
185
+ }
186
+ }
187
+
188
+ if ( minutes < 10 ) {
189
+ minutes = '0' + minutes;
190
+ }
191
+
192
+ return hours + ":" + minutes;
193
+ }
194
195
function um_ajax_get_members( directory, args ) {
196
246
var filter_name = filter.find( '.um-timepicker-filter' ).data('filter_name');
247
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
248
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
249
+
250
+ if ( typeof value_from != 'undefined' ) {
251
+ var value_from = value_from.split(':');
252
+ var hours = value_from[0]*1;
253
+ if ( hours < 10 ) {
254
+ hours = '0' + hours;
255
+ }
256
+
257
+ var minutes = value_from[1]*1;
258
+ if ( minutes < 10 ) {
259
+ minutes = '0' + minutes;
260
+ }
261
+
262
+ value_from = hours + ':' + minutes + ':00';
263
+ }
264
+ if ( typeof value_to != 'undefined' ) {
265
+ var val_to = value_to.split(':');
266
+ var minutes = val_to[1]*1;
267
+
268
+ var hours = val_to[0]*1;
269
+ if ( hours < 10 ) {
270
+ hours = '0' + hours;
271
+ }
272
+
273
+ if ( minutes < 10 ) {
274
+ minutes = '0' + minutes;
275
+ }
276
+
277
+ value_to = hours + ':' + minutes + ':59';
278
+ }
279
+
280
+ if ( typeof value_from != 'undefined' || typeof value_to != 'undefined' ) {
281
request[ filter_name ] = [ value_from, value_to ];
282
}
283
+ } else if ( filter.find( 'select' ).length ) {
284
var filter_name = filter.find('select').attr('name');
285
var value = um_get_data_for_directory( directory, 'filter_' + filter_name );
286
if ( typeof value != 'undefined' ) {
287
request[ filter_name ] = value.split( '||' );
288
}
289
+ } else {
290
+ var filter_name = filter.find('input[type="text"]').attr('name');
291
+ var value = um_get_data_for_directory( directory, 'filter_' + filter_name );
292
+ if ( typeof value != 'undefined' ) {
293
+ request[ filter_name ] = value;
294
+ }
295
}
296
});
297
}
337
338
function um_build_template( directory, data ) {
339
var layout = directory.data('view_type');
340
+ var template = wp.template( 'um-member-' + layout + '-' + um_members_get_hash( directory ) );
341
342
directory.find('.um-members-grid, .um-members-list').remove();
343
directory.find('.um-members-wrapper').prepend( template( data.users ) );
344
345
var header_template = wp.template( 'um-members-header' );
346
directory.find('.um-members-intro').remove();
347
+ if ( typeof data.is_search != 'undefined' && data.is_search ) {
348
+ directory.find('.um-members-wrapper').prepend( header_template( data ) );
349
+ }
350
351
directory.addClass('um-loaded');
352
474
filters_data.push( {'name':filter_name, 'label':filter_title, 'value_label':filter_value_title, 'value':filter_value[ i ], 'type':filter_type} );
475
});
476
477
+ } else if( filter.find('input[type="text"]').length ) {
478
+
479
+ filter_type = 'text';
480
+ filter_name = filter.find('input[type="text"]').attr('name');
481
+ filter_title = filter.find('input[type="text"]').attr('placeholder');
482
+
483
+ var filter_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
484
+ if ( typeof filter_value == 'undefined' ) {
485
+ filter_value = '';
486
+ }
487
+
488
+ if ( filter_value != '' ) {
489
+ filters_data.push( {'name':filter_name, 'label':filter_title, 'value_label':filter_value, 'value':filter_value, 'type':filter_type} );
490
+ }
491
+
492
} else if( filter.find('div.ui-slider').length ) {
493
filter_type = 'slider';
494
520
directory.find('.um-members-filter-tag').remove();
521
522
var filtered_line = directory.find('.um-filtered-line');
523
+ if ( filtered_line.length ) {
524
var filters_template = wp.template( 'um-members-filtered-line' );
525
filtered_line.prepend( filters_template( {'filters': filters_data} ) );
526
949
directory.data( 'searched', 1 );
950
directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
951
directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
952
+ // if ( directory.find( '.um-search-filter select[data-um-parent="' + filter_name + '"]' ).length > 0 ) {
953
+ // jQuery(this).trigger('change');
954
+ // }
955
});
956
957
958
+ jQuery( document.body ).on( 'blur', '.um-directory .um-search-filter.um-text-filter-type input[type="text"]', function() {
959
var directory = jQuery(this).parents('.um-directory');
960
961
+ if ( um_is_directory_busy( directory ) ) {
962
+ return;
963
+ }
964
+
965
+ var current_value = jQuery(this).val();
966
+ var filter_name = jQuery(this).prop('name');
967
+ var url_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
968
+
969
+ if ( typeof url_value == 'undefined' ) {
970
+ url_value = '';
971
+ }
972
+
973
+ if ( current_value === url_value ) {
974
return;
975
}
976
977
um_members_show_preloader( directory );
978
+ um_set_url_from_data( directory, 'filter_' + filter_name, current_value );
979
+
980
+ //set 1st page after filtration
981
+ directory.data( 'page', 1 );
982
+ um_set_url_from_data( directory, 'page', '' );
983
+
984
+ um_ajax_get_members( directory );
985
+
986
+ um_change_tag( directory );
987
+
988
+ directory.data( 'searched', 1 );
989
+ directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
990
+ directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
991
+ });
992
+
993
+
994
+ //make search on Enter click
995
+ jQuery( document.body ).on( 'keypress', '.um-directory .um-search-filter.um-text-filter-type input[type="text"]', function(e) {
996
+ if ( e.which === 13 ) {
997
+ var directory = jQuery(this).parents('.um-directory');
998
+
999
+ if ( um_is_directory_busy( directory ) ) {
1000
+ return;
1001
+ }
1002
+
1003
+ var current_value = jQuery(this).val();
1004
+ var filter_name = jQuery(this).prop('name');
1005
+ var url_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
1006
+
1007
+ if ( typeof url_value == 'undefined' ) {
1008
+ url_value = '';
1009
+ }
1010
+
1011
+ if ( current_value === url_value ) {
1012
+ return;
1013
+ }
1014
+
1015
+ um_members_show_preloader( directory );
1016
+ um_set_url_from_data( directory, 'filter_' + filter_name, current_value );
1017
+
1018
+ //set 1st page after filtration
1019
+ directory.data( 'page', 1 );
1020
+ um_set_url_from_data( directory, 'page', '' );
1021
+
1022
+ um_ajax_get_members( directory );
1023
+
1024
+ um_change_tag( directory );
1025
+
1026
+ directory.data( 'searched', 1 );
1027
+ directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
1028
+ directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
1029
+ }
1030
+ });
1031
+
1032
+
1033
+
1034
+ jQuery( document.body ).on( 'click', '.um-directory .um-members-filter-remove', function() {
1035
+ var directory = jQuery(this).parents('.um-directory');
1036
+
1037
+ if ( um_is_directory_busy(directory) || ! directory ) {
1038
+ return;
1039
+ }
1040
+
1041
+ um_members_show_preloader(directory);
1042
1043
var removeItem = jQuery(this).data('value');
1044
var filter_name = jQuery(this).data('name');
1045
1046
var type = jQuery(this).data('type');
1047
+ if ( type === 'text' ) {
1048
+ um_set_url_from_data( directory, 'filter_' + filter_name,'' );
1049
+
1050
+ jQuery( '.um-search-filter input[name="' + filter_name + '"]' ).val('');
1051
+
1052
+ } else if ( type === 'select' ) {
1053
1054
var current_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
1055
if ( typeof current_value == 'undefined' ) {
1070
1071
um_set_url_from_data( directory, 'filter_' + filter_name, current_value );
1072
1073
var select = jQuery( '.um-search-filter select[name="' + filter_name + '"]' );
1074
select.find('option[value="' + removeItem + '"]').prop('disabled', false).show();
1075
1079
}
1080
select.select2('destroy').select2();
1081
1082
+ if ( directory.find( '.um-search-filter select[data-um-parent="' + filter_name + '"]' ).length > 0 ) {
1083
+ select.trigger('change');
1084
+ }
1085
+
1086
} else if ( type === 'slider' ) {
1087
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1088
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1141
var filter_name = jQuery(this).data('name');
1142
1143
var type = jQuery(this).data('type');
1144
+ if ( type === 'text' ) {
1145
+ um_set_url_from_data( directory, 'filter_' + filter_name,'' );
1146
+
1147
+ jQuery( '.um-search-filter input[name="' + filter_name + '"]' ).val('');
1148
+
1149
+ } else if ( type === 'select' ) {
1150
1151
var current_value = um_get_data_for_directory( directory, 'filter_' + filter_name );
1152
if ( typeof current_value == 'undefined' ) {
1179
} else if ( type === 'slider' ) {
1180
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1181
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1182
+
1183
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_from"]' ).val('');
1184
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_to"]' ).val('');
1185
} else if ( type === 'datepicker' ) {
1186
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1187
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1188
+
1189
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_from"]' ).val('');
1190
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_to"]' ).val('');
1191
} else if ( type === 'timepicker' ) {
1192
um_set_url_from_data( directory, 'filter_' + filter_name + '_from','' );
1193
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', '' );
1194
+
1195
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_from"]' ).val('');
1196
+ jQuery( '.um-search-filter input[name="filter_' + filter_name + '_to"]' ).val('');
1197
}
1198
});
1199
1242
var hash = um_members_get_hash( directory );
1243
um_member_directories.push( hash );
1244
1245
+ // slideup/slidedown animation fix for grid filters bar
1246
if ( directory.find('.um-search').length ) {
1247
if ( ! directory.find('.um-search').is(':visible') ) {
1248
directory.find('.um-search').css({
1387
//timepicker filter
1388
directory.find('.um-timepicker-filter').each( function() {
1389
var elem = jQuery(this);
1390
+ var elemID = elem.attr('id');
1391
+ var elem_filter_name = elem.data('filter_name');
1392
1393
//using arrays formatted as [HOUR,MINUTE]
1394
+ var min = elem.attr('data-min');
1395
+ var max = elem.attr('data-max');
1396
1397
var picker_min = min.split(':');
1398
var picker_max = max.split(':');
1399
1407
onOpen: function() { elem.blur(); },
1408
onClose: function() { elem.blur(); },
1409
onSet: function( context ) {
1410
+
1411
var directory = elem.parents('.um-directory');
1412
1413
if ( um_is_directory_busy( directory ) ) {
1429
}
1430
1431
if ( typeof context.select !== 'undefined' ) {
1432
+ var select_val = um_time_convert( context.select, range );
1433
+
1434
+ //var select_val = context.select / 60;
1435
1436
if ( range === 'from' ) {
1437
+ current_value_from = select_val;
1438
} else if ( range === 'to' ) {
1439
+ current_value_to = select_val;
1440
}
1441
} else {
1442
if ( range === 'from' ) {
1446
}
1447
}
1448
1449
+ var time = jQuery( '#' + elemID ).val();
1450
+
1451
+ if ( elem.data('range') === 'from' ) {
1452
+ jQuery( '#' + elem_filter_name + '_to' ).pickatime('picker').set('min', time);
1453
+ } else {
1454
+ jQuery( '#' + elem_filter_name + '_from').pickatime('picker').set('max', time);
1455
+ }
1456
+
1457
um_set_url_from_data( directory, 'filter_' + filter_name + '_from', current_value_from );
1458
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', current_value_to );
1459
1468
directory.data( 'searched', 1 );
1469
directory.find( '.um-member-directory-sorting-options' ).prop( 'disabled', false );
1470
directory.find( '.um-member-directory-view-type' ).removeClass( 'um-disabled' );
1471
+
1472
}
1473
});
1474
1475
+ // first loading timepicker select
1476
var $picker = $input.pickatime('picker');
1477
var $fname = elem.data('filter_name');
1478
var $frange = elem.data('range');
1481
var query_value = um_get_data_for_directory( $directory, 'filter_' + $fname + '_' + $frange );
1482
if ( typeof query_value !== 'undefined' ) {
1483
var arr = query_value.split(':');
1484
+ $picker.set( 'select', arr[0]*60 + arr[1]*1 );
1485
}
1486
+
1487
});
1488
1489
+ var show_after_search = directory.data('must-search');
1490
+ if ( show_after_search === 1 ) {
1491
+ var search = um_get_search( directory );
1492
+ var filters_data = um_get_filters_data( directory );
1493
+ if ( ! filters_data.length && ! search ) {
1494
+ return;
1495
+ }
1496
+ }
1497
+
1498
+ um_members_show_preloader( directory );
1499
+ um_ajax_get_members( directory, {first_load:true} );
1500
um_change_tag( directory );
1501
});
1502
assets/js/um-members.min.js CHANGED
@@ -1 +1 @@
1
- var um_members_directory_busy=[],um_member_directories=[],um_member_directory_last_data=[];function um_parse_current_url(){var t={},a=window.location.search.substring(1).split("&");return jQuery.each(a,function(e){var r=a[e].split("=");t[r[0]]=r[1]}),t}function um_get_data_for_directory(e,r){var t=um_members_get_hash(e),a={},i=um_parse_current_url();if(jQuery.each(i,function(e){-1!==e.indexOf("_"+t)&&""!==i[e]&&(a[e.replace("_"+t,"")]=i[e])}),r){if(void 0!==a[r])try{a[r]=decodeURI(a[r])}catch(e){console.error(e)}return a[r]}return a}function um_set_url_from_data(e,r,t){var a=um_members_get_hash(e),i=um_get_data_for_directory(e),m={};""!==t&&(m[r+"_"+a]=t),jQuery.each(i,function(e){r===e?""!==t&&(m[e+"_"+a]=t):m[e+"_"+a]=i[e]}),jQuery.each(um_member_directories,function(e){var r=um_member_directories[e];if(r!==a){var t=um_get_data_for_directory(jQuery('.um-directory[data-hash="'+r+'"]'));jQuery.each(t,function(e){m[e+"_"+r]=t[e]})}});var d=[];jQuery.each(m,function(e){d.push(e+"="+m[e])});var u="?"+(d=wp.hooks.applyFilters("um_member_directory_url_attrs",d)).join("&");"?"===u&&(u=""),window.history.pushState("string","UM Member Directory",window.location.origin+window.location.pathname+u)}function um_members_get_hash(e){return e.data("hash")}function um_is_directory_busy(e){var r=um_members_get_hash(e);return void 0!==um_members_directory_busy[r]&&um_members_directory_busy[r]}function um_members_show_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!0,e.find(".um-members-overlay").show()}function um_members_hide_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!1,e.find(".um-members-overlay").hide()}function um_set_range_label(e,r){var t=e.siblings(".um-slider-range").data("placeholder");t=r?t.replace("{min_range}",r.values[0]).replace("{max_range}",r.values[1]).replace("{field_label}",e.siblings(".um-slider-range").data("label")):t.replace("{min_range}",e.slider("values",0)).replace("{max_range}",e.slider("values",1)).replace("{field_label}",e.siblings(".um-slider-range").data("label")),e.siblings(".um-slider-range").html(t),e.siblings(".um_range_min").val(e.slider("values",0)),e.siblings(".um_range_max").val(e.slider("values",1))}function um_get_search(e){return e.find(".um-search-line").length?e.find(".um-search-line").val():""}function um_get_sort(e){return e.data("sorting")}function um_get_current_page(e){var r=e.data("page");return r&&void 0!==r||(r=1),r}function um_ajax_get_members(m,t){var a=um_members_get_hash(m),e=um_get_current_page(m),r=um_get_search(m),i=um_get_sort(m),d=-(new Date).getTimezoneOffset()/60,u={directory_id:a,page:e,search:r,sorting:i,gmt_offset:d,post_refferer:m.data("base-post"),nonce:um_scripts.nonce};m.find(".um-search-filter").length&&m.find(".um-search-filter").each(function(){var e=jQuery(this);if(e.find(".um-slider").length){var r=e.find(".um-slider").data("field_name"),t=um_get_data_for_directory(m,"filter_"+r+"_from"),a=um_get_data_for_directory(m,"filter_"+r+"_to");void 0===t&&void 0===a||(u[r]=[t,a])}else if(e.find(".um-datepicker-filter").length){r=e.find(".um-datepicker-filter").data("filter_name"),t=um_get_data_for_directory(m,"filter_"+r+"_from"),a=um_get_data_for_directory(m,"filter_"+r+"_to");void 0===t&&void 0===a||(u[r]=[t,a])}else if(e.find(".um-timepicker-filter").length){r=e.find(".um-timepicker-filter").data("filter_name"),t=um_get_data_for_directory(m,"filter_"+r+"_from"),a=um_get_data_for_directory(m,"filter_"+r+"_to");void 0===t&&void 0===a||(u[r]=[t,a])}else{r=e.find("select").attr("name");var i=um_get_data_for_directory(m,"filter_"+r);void 0!==i&&(u[r]=i.split("||"))}}),u=wp.hooks.applyFilters("um_member_directory_filter_request",u),wp.ajax.send("um_get_members",{data:u,success:function(e){um_member_directory_last_data[a]=e,um_build_template(m,e);var r=wp.template("um-members-pagination");m.find(".um-members-pagination-box").html(r(e)),m.data("total_pages",e.pagination.total_pages),e.pagination.total_pages?(m.find(".um-member-directory-sorting-options").prop("disabled",!1),m.find(".um-member-directory-view-type").removeClass("um-disabled")):(m.find(".um-member-directory-sorting-options").prop("disabled",!0),m.find(".um-member-directory-view-type").addClass("um-disabled")),jQuery(document).trigger("um_members_rendered",t),um_init_new_dropdown(),um_members_hide_preloader(m)},error:function(e){console.log(e),um_members_hide_preloader(m)}})}function um_build_template(e,r){var t=e.data("view_type"),a=wp.template("um-member-"+t);e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-members-wrapper").prepend(a(r.users));var i=wp.template("um-members-header");e.find(".um-members-intro").remove(),e.find(".um-members-wrapper").prepend(i(r)),e.addClass("um-loaded"),e.find(".um-members.um-members-grid").length&&UM_Member_Grid(e.find(".um-members.um-members-grid")),jQuery(document).trigger("um_build_template",[e,r]),jQuery(window).trigger("resize"),init_tipsy()}function UM_Member_Grid(e){e.find(".um-member").length&&e.imagesLoaded(function(){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"}).on("layoutComplete",function(e,r){jQuery(document).trigger("um_grid_initialized",[e,r])})})}function um_get_filters_data(s){var _=[];return s.find(".um-search-filter").each(function(){var t,a,d,i=jQuery(this);if(i.find("input.um-datepicker-filter").length)d="datepicker",i.find("input.um-datepicker-filter").each(function(){if("to"!==jQuery(this).data("range")){var e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(s,"filter_"+e+"_from"),t=um_get_data_for_directory(s,"filter_"+e+"_to");if(void 0!==r||void 0!==t){var a,i=jQuery(this).val(),m=s.find('input.um-datepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val();i===m?a=m:""!==i&&""!==m?a=i+" - "+m:""===i?a="before "+m:""===m&&(a="since "+i),_.push({name:e,label:jQuery(this).data("filter-label"),value_label:a,value:[r,t],type:d})}}});else if(i.find("input.um-timepicker-filter").length)d="timepicker",i.find("input.um-timepicker-filter").each(function(){if("to"!==jQuery(this).data("range")){var e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(s,"filter_"+e+"_from"),t=um_get_data_for_directory(s,"filter_"+e+"_to");if(void 0!==r||void 0!==t){var a,i=jQuery(this).val(),m=s.find('input.um-timepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val();i===m?a=m:""!==i&&""!==m?a=i+" - "+m:""===i?a="before "+m:""===m&&(a="since "+i),_.push({name:e,label:jQuery(this).data("filter-label"),value_label:a,value:[r,t],type:d})}}});else if(i.find("select").length){d="select",t=i.find("select").attr("name"),a=i.find("select").data("placeholder");var m=um_get_data_for_directory(s,"filter_"+t);m=void 0===m?[]:m.split("||"),jQuery.each(m,function(e){var r=i.find('select option[value="'+m[e]+'"]').data("value_label");_.push({name:t,label:a,value_label:r,value:m[e],type:d})})}else if(i.find("div.ui-slider").length){d="slider",t=i.find("div.ui-slider").data("field_name");var e=um_get_data_for_directory(s,"filter_"+t+"_from"),r=um_get_data_for_directory(s,"filter_"+t+"_to");if(void 0===e&&void 0===r)return;a=i.find("div.um-slider-range").data("label");var u=i.find("div.um-slider-range").data("placeholder").replace("{min_range}",e).replace("{max_range}",r).replace("{field_label}",i.find("div.um-slider-range").data("label"));_.push({name:t,label:a,value_label:u,value:[e,r],type:d})}}),_}function um_change_tag(e){var r=um_get_filters_data(e);e.find(".um-members-filter-tag").remove();var t=e.find(".um-filtered-line");if(t.length){var a=wp.template("um-members-filtered-line");t.prepend(a({filters:r})),0===e.find(".um-members-filter-remove").length?(e.find(".um-clear-filters").hide(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").addClass("um-header-row-invisible")):(e.find(".um-clear-filters").show(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").removeClass("um-header-row-invisible"))}}function um_run_search(e){if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=um_get_data_for_directory(e,"search");if((t=e.find(".um-search-line").val())===r||""===t&&void 0===r)um_members_hide_preloader(e);else{if(e.data("general_search",t),um_set_url_from_data(e,"search",t),e.data("page",1),um_set_url_from_data(e,"page",""),1===e.data("must-search")){var t=um_get_search(e);if(0===e.find(".um-members-filter-remove").length&&!t)return e.data("searched",0),e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-member-directory-sorting-options").prop("disabled",!0),e.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(e)}e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(e)}}}jQuery(document.body).ready(function(){jQuery(".um-directory .um-search-filter select").each(function(){1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),jQuery(this).select2("destroy").select2()}),jQuery(document.body).on("mouseover",".um-directory .um-member-directory-view-type",function(){if(!jQuery(this).hasClass("um-disabled")){var e=jQuery(this).find(".um-member-directory-view-type-a:visible");e.hide(),e.next().length?e.next().show().tipsy("show"):jQuery(this).find(".um-member-directory-view-type-a:first").show().tipsy("show")}}).on("mouseout",".um-directory .um-member-directory-view-type",function(){jQuery(this).hasClass("um-disabled")||(jQuery(this).find(".um-member-directory-view-type-a").hide().tipsy("hide"),jQuery(this).find('.um-member-directory-view-type-a[data-type="'+jQuery(this).parents(".um-directory").data("view_type")+'"]').show())}),jQuery(document.body).on("click",".um-directory .um-member-directory-view-type-a",function(){var e=jQuery(this).parents(".um-directory");if(um_is_directory_busy(e))return!1;var r=jQuery(this),t=r.parents(".um-member-directory-view-type");if(!t.hasClass("um-disabled")){um_members_show_preloader(e);var a=t.find(".um-member-directory-view-type-a:visible");a.hide(),a.next().length?a.next().show().tipsy("show"):t.find(".um-member-directory-view-type-a:first").show().tipsy("show");var i=um_member_directory_last_data[um_members_get_hash(e)];if(null!==i){var m=r.data("type");um_set_url_from_data(e,"view_type",m),e.data("view_type",m),um_build_template(e,i)}um_members_hide_preloader(e)}}),jQuery(document.body).on("click",".um-directory .um-do-search",function(){um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("keypress",".um-directory .um-search-line",function(e){13===e.which&&um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("click",".um-directory .um-member-directory-sorting-a .um-new-dropdown li a",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&1!==jQuery(this).data("selected")){um_members_show_preloader(e);var r=jQuery(this).data("value");e.data("sorting",r),um_set_url_from_data(e,"sort",r),um_ajax_get_members(e),jQuery(this).parents(".um-new-dropdown").find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),jQuery(this).data("selected",1).prop("data-selected",1).attr("data-selected",1),jQuery(this).parents(".um-member-directory-sorting-a").find("> a").html(jQuery(this).html())}}),jQuery(document.body).on("click",".um-directory .pagi:not(.current)",function(){if(!jQuery(this).hasClass("disabled")){var e,r=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(r))um_members_show_preloader(r),1===(e="first"===jQuery(this).data("page")?1:"prev"===jQuery(this).data("page")?1*r.data("page")-1:"next"===jQuery(this).data("page")?1*r.data("page")+1:"last"===jQuery(this).data("page")?parseInt(r.data("total_pages")):parseInt(jQuery(this).data("page")))?(r.find('.pagi[data-page="first"], .pagi[data-page="prev"]').addClass("disabled"),r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled")):(e===parseInt(r.data("total_pages"))?r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').addClass("disabled"):r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled"),r.find('.pagi[data-page="first"], .pagi[data-page="prev"]').removeClass("disabled")),r.find(".pagi").removeClass("current"),r.find('.pagi[data-page="'+e+'"]').addClass("current"),r.data("page",e),um_set_url_from_data(r,"page",1===e?"":e),um_ajax_get_members(r)}}),jQuery(document.body).on("change",".um-directory .um-members-pagi-dropdown",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=jQuery(this).val();e.find(".pagi").removeClass("current"),e.find('.pagi[data-page="'+r+'"]').addClass("current"),e.data("page",r),um_set_url_from_data(e,"page",1===r?"":r),um_ajax_get_members(e)}}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-more a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member");return r.find(".um-member-more").hide(),r.find(".um-member-meta-main").slideDown(),r.find(".um-member-less").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member");return r.find(".um-member-less").hide(),r.find(".um-member-meta-main").slideUp(),r.find(".um-member-more").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-more a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-more").hide(),r.find(".um-member-meta").slideDown(function(){UM_Member_Grid(t)}),r.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(t)},100),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-less").hide(),r.find(".um-member-meta").slideUp(function(){r.find(".um-member-more").fadeIn(),UM_Member_Grid(t)}),!1}),jQuery(".um-member-directory-filters-a").click(function(){var e=jQuery(this),r=e.parents(".um-directory").find(".um-search");r.is(":visible")?r.slideUp(250,function(){e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}):r.slideDown({duration:250,start:function(){jQuery(this).css({display:"grid"}),e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}})}),jQuery(document.body).on("change",".um-directory .um-search-filter select",function(){if(""!==jQuery(this).val()){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=jQuery(this).prop("name"),t=um_get_data_for_directory(e,"filter_"+r);t=void 0===t?[]:t.split("||"),-1===jQuery.inArray(jQuery(this).val(),t)&&(t.push(jQuery(this).val()),um_set_url_from_data(e,"filter_"+r,t=t.join("||")),e.data("page",1),um_set_url_from_data(e,"page","")),jQuery(this).find('option[value="'+jQuery(this).val()+'"]').prop("disabled",!0).hide(),1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),jQuery(this).select2("destroy").select2(),jQuery(this).val("").trigger("change"),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled")}}}),jQuery(document.body).on("click",".um-directory .um-members-filter-remove",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&e){um_members_show_preloader(e);var r=jQuery(this).data("value"),t=jQuery(this).data("name"),a=jQuery(this).data("type");if("select"===a){var i=um_get_data_for_directory(e,"filter_"+t);i=void 0===i?[]:i.split("||"),-1!==jQuery.inArray(r.toString(),i)&&(i=jQuery.grep(i,function(e){return e!==r.toString()})),i.length||(i=""),um_set_url_from_data(e,"filter_"+t,i);var m=jQuery('.um-search-filter select[name="'+t+'"]');m.find('option[value="'+r+'"]').prop("disabled",!1).show(),1<m.find("option:not(:disabled)").length&&m.prop("disabled",!1),m.select2("destroy").select2()}else"slider"===a?(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to","")):"datepicker"===a?(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to","")):"timepicker"===a&&(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to",""));if(e.data("page",1),um_set_url_from_data(e,"page",""),jQuery(this).tipsy("hide"),jQuery(this).parents(".um-members-filter-tag").remove(),0===e.find(".um-members-filter-remove").length?e.find(".um-clear-filters").hide():e.find(".um-clear-filters").show(),1===e.data("must-search")){var d=um_get_search(e);if(0===e.find(".um-members-filter-remove").length&&!d)return e.data("searched",0),e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-member-directory-sorting-options").prop("disabled",!0),e.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(e)}e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(e)}}),jQuery(document.body).on("click",".um-directory .um-clear-filters-a",function(){var m=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(m)){if(um_members_show_preloader(m),m.find(".um-members-filter-remove").each(function(){var r=jQuery(this).data("value"),e=jQuery(this).data("name"),t=jQuery(this).data("type");if("select"===t){var a=um_get_data_for_directory(m,"filter_"+e);a=void 0===a?[]:a.split("||"),-1!==jQuery.inArray(r.toString(),a)&&(a=jQuery.grep(a,function(e){return e!==r.toString()})),a.length||(a=""),um_set_url_from_data(m,"filter_"+e,a);var i=jQuery('.um-search-filter select[name="'+e+'"]');i.find('option[value="'+r+'"]').prop("disabled",!1).show(),1<i.find("option:not(:disabled)").length&&i.prop("disabled",!1),i.select2("destroy").select2()}else"slider"===t?(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to","")):"datepicker"===t?(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to","")):"timepicker"===t&&(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to",""))}),m.data("page",1),um_set_url_from_data(m,"page",""),m.find(".um-members-filter-tag").remove(),0===m.find(".um-members-filter-remove").length?(m.find(".um-clear-filters").hide(),m.find(".um-clear-filters").parents(".um-member-directory-header-row").addClass("um-header-row-invisible")):(m.find(".um-clear-filters").show(),m.find(".um-clear-filters").parents(".um-member-directory-header-row").removeClass("um-header-row-invisible")),1===m.data("must-search"))if(!um_get_search(m))return m.data("searched",0),m.find(".um-members-grid, .um-members-list").remove(),m.find(".um-member-directory-sorting-options").prop("disabled",!0),m.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(m);m.find(".um-member-directory-sorting-options").prop("disabled",!1),m.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(m)}}),jQuery(".um-directory").each(function(){var e=jQuery(this),r=um_members_get_hash(e);if(um_member_directories.push(r),1===e.data("must-search")){var t=um_get_search(e);if(!um_get_filters_data(e).length&&!t)return}um_members_show_preloader(e),um_ajax_get_members(e,{first_load:!0}),e.find(".um-search").length&&(e.find(".um-search").is(":visible")||e.find(".um-search").css({display:"grid"}).slideUp(1)),e.find(".um-slider").each(function(){var e=jQuery(this),t=e.parents(".um-directory"),a=e.data("field_name"),r=um_get_data_for_directory(t,"filter_"+a+"_from"),i=um_get_data_for_directory(t,"filter_"+a+"_to");void 0===r&&(r=parseInt(e.data("min"))),void 0===i&&(i=parseInt(e.data("max")));var m=[r,i];e.slider({range:!0,min:parseInt(e.data("min")),max:parseInt(e.data("max")),values:m,create:function(e,r){},step:1,slide:function(e,r){um_set_range_label(jQuery(this),r)},stop:function(e,r){um_is_directory_busy(t)||(um_set_url_from_data(t,"filter_"+a+"_from",r.values[0]),um_set_url_from_data(t,"filter_"+a+"_to",r.values[1]),t.data("page",1),um_set_url_from_data(t,"page",""),um_ajax_get_members(t),um_change_tag(t),t.data("searched",1),t.find(".um-member-directory-sorting-options").prop("disabled",!1),t.find(".um-member-directory-view-type").removeClass("um-disabled"))}}),um_set_range_label(e)}),e.find(".um-datepicker-filter").each(function(){var u=jQuery(this),s=new Date(1e3*u.data("date_min")),_=new Date(1e3*u.data("date_max")),e=u.pickadate({selectYears:!0,min:s,max:_,formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){u.blur()},onClose:function(){u.blur()},onSet:function(e){var r=u.parents(".um-directory");if(!um_is_directory_busy(r)){um_members_show_preloader(r);var t=u.data("filter_name"),a=u.data("range"),i=um_get_data_for_directory(r,"filter_"+t+"_from"),m=um_get_data_for_directory(r,"filter_"+t+"_to");void 0===i&&(i=s/1e3),void 0===m&&(m=_/1e3);var d=e.select/1e3;u.val();"from"===a?i=d:"to"===a&&(m=d),um_set_url_from_data(r,"filter_"+t+"_from",i),um_set_url_from_data(r,"filter_"+t+"_to",m),r.data("page",1),um_set_url_from_data(r,"page",""),um_ajax_get_members(r),um_change_tag(r),r.data("searched",1),r.find(".um-member-directory-sorting-options").prop("disabled",!1),r.find(".um-member-directory-view-type").removeClass("um-disabled")}}}).pickadate("picker"),r=u.data("filter_name"),t=u.data("range"),a=um_get_data_for_directory(u.parents(".um-directory"),"filter_"+r+"_"+t);void 0!==a&&e.set("select",1e3*a)}),e.find(".um-timepicker-filter").each(function(){var u=jQuery(this),s=u.data("min"),_=u.data("max"),e=s.split(":"),r=_.split(":"),t=u.pickatime({format:u.data("format"),interval:parseInt(u.data("intervals")),min:[e[0],e[1]],max:[r[0],r[1]],formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){u.blur()},onClose:function(){u.blur()},onSet:function(e){var r=u.parents(".um-directory");if(!um_is_directory_busy(r)){um_members_show_preloader(r);var t=u.data("filter_name"),a=u.data("range"),i=um_get_data_for_directory(r,"filter_"+t+"_from"),m=um_get_data_for_directory(r,"filter_"+t+"_to");if(void 0===i&&(i=s),void 0===m&&(m=_),void 0!==e.select){var d=e.select/60;u.val();"from"===a?i=d+":00":"to"===a&&(m=d+":00")}else"from"===a?i=s:"to"===a&&(m=_);um_set_url_from_data(r,"filter_"+t+"_from",i),um_set_url_from_data(r,"filter_"+t+"_to",m),r.data("page",1),um_set_url_from_data(r,"page",""),um_ajax_get_members(r),um_change_tag(r),r.data("searched",1),r.find(".um-member-directory-sorting-options").prop("disabled",!1),r.find(".um-member-directory-view-type").removeClass("um-disabled")}}}).pickatime("picker"),a=u.data("filter_name"),i=u.data("range"),m=um_get_data_for_directory(u.parents(".um-directory"),"filter_"+a+"_"+i);if(void 0!==m){var d=m.split(":");t.set("select",60*d[0])}}),um_change_tag(e)}),window.addEventListener("popstate",function(e){jQuery(".um-directory").each(function(){var d=jQuery(this),e=um_members_get_hash(d);(um_member_directories.push(e),um_members_show_preloader(d),d.find(".um-members-grid, .um-members-list, .um-members-intro").remove(),d.find(".um-member-directory-search-line").length)&&(void 0===(m=um_get_data_for_directory(d,"search"))&&(m=""),d.data("general_search",m),d.find(".um-search-line").val(m));var r=um_get_data_for_directory(d,"page");if(void 0===r?r=1:r>d.data("total_pages")&&(r=d.data("total_pages")),d.data("page",r).attr("data-page",r),d.find(".um-member-directory-sorting").length){var t=um_get_data_for_directory(d,"sort");void 0===t&&(t=d.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]').find('a[data-default="1"]').data("value")),d.data("sorting",t);var a=d.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]');a.find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),a.find('a[data-value="'+t+'"]').data("selected",1).prop("data-selected",1).attr("data-selected",1),d.find(".um-member-directory-sorting-a").find("> a").html(a.find('a[data-value="'+t+'"]').html())}if(d.find(".um-member-directory-view-type").length){var i=um_get_data_for_directory(d,"view_type");void 0===i&&(i=d.find('.um-member-directory-view-type-a[data-default="1"]').data("type")),d.data("view_type",i),d.find(".um-member-directory-view-type .um-member-directory-view-type-a").hide(),d.find('.um-member-directory-view-type .um-member-directory-view-type-a[data-type="'+i+'"]').show()}if(d.find(".um-datepicker-filter").each(function(){var e=jQuery(this),r=e.pickadate("picker"),t=e.data("filter_name"),a=e.data("range"),i=um_get_data_for_directory(d,"filter_"+t+"_"+a);void 0!==i?r.set("select",1e3*i):r.clear()}),d.find(".um-slider").each(function(){var e=jQuery(this),r=e.data("field_name"),t=um_get_data_for_directory(d,"filter_"+r+"_from"),a=um_get_data_for_directory(d,"filter_"+r+"_to");void 0===t&&(t=e.data("min")),t=parseInt(t),void 0===a&&(a=e.data("max")),a=parseInt(a),e.slider("values",[t,a]),um_set_range_label(e)}),d.find(".um-timepicker-filter").each(function(){var e=jQuery(this),r=e.pickatime("picker"),t=e.data("filter_name"),a=e.data("range"),i=um_get_data_for_directory(d,"filter_"+t+"_"+a);if(void 0!==i){var m=i.split(":");r.set("select",60*m[0])}else r.clear()}),1===d.data("must-search")){var m=um_get_search(d);if(!um_get_filters_data(d).length&&!m)return d.data("searched",0),void um_members_hide_preloader(d);d.data("searched",1)}um_ajax_get_members(d),um_change_tag(d)})})});
1
+ var um_members_directory_busy=[],um_member_directories=[],um_member_directory_last_data=[];function um_parse_current_url(){var t={},a=window.location.search.substring(1).split("&");return jQuery.each(a,function(e){var r=a[e].split("=");t[r[0]]=r[1]}),t}function um_get_data_for_directory(e,r){var t=um_members_get_hash(e),a={},i=um_parse_current_url();if(jQuery.each(i,function(e){-1!==e.indexOf("_"+t)&&""!==i[e]&&(a[e.replace("_"+t,"")]=i[e])}),r){if(void 0!==a[r])try{a[r]=decodeURIComponent(a[r])}catch(e){console.error(e)}return a[r]}return a}function um_set_url_from_data(e,r,t){var a=um_members_get_hash(e),i=um_get_data_for_directory(e),m={};jQuery.isArray(t)?(jQuery.each(t,function(e){t[e]=encodeURIComponent(t[e])}),t=t.join("||")):jQuery.isNumeric(t)||(t=t.split("||"),jQuery.each(t,function(e){t[e]=encodeURIComponent(t[e])}),t=t.join("||")),""!==t&&(m[r+"_"+a]=t),jQuery.each(i,function(e){r===e?""!==t&&(m[e+"_"+a]=t):m[e+"_"+a]=i[e]}),jQuery.each(um_member_directories,function(e){var r=um_member_directories[e];if(r!==a){var t=um_get_data_for_directory(jQuery('.um-directory[data-hash="'+r+'"]'));jQuery.each(t,function(e){m[e+"_"+r]=t[e]})}});var d=[];jQuery.each(m,function(e){d.push(e+"="+m[e])});var u="?"+(d=wp.hooks.applyFilters("um_member_directory_url_attrs",d)).join("&");"?"===u&&(u=""),window.history.pushState("string","UM Member Directory",window.location.origin+window.location.pathname+u)}function um_members_get_hash(e){return e.data("hash")}function um_is_directory_busy(e){var r=um_members_get_hash(e);return void 0!==um_members_directory_busy[r]&&um_members_directory_busy[r]}function um_members_show_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!0,e.find(".um-members-overlay").show()}function um_members_hide_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!1,e.find(".um-members-overlay").hide()}function um_set_range_label(e,r){var t=e.siblings(".um-slider-range").data("placeholder");t=r?t.replace("{min_range}",r.values[0]).replace("{max_range}",r.values[1]).replace("{field_label}",e.siblings(".um-slider-range").data("label")):t.replace("{min_range}",e.slider("values",0)).replace("{max_range}",e.slider("values",1)).replace("{field_label}",e.siblings(".um-slider-range").data("label")),e.siblings(".um-slider-range").html(t),e.siblings(".um_range_min").val(e.slider("values",0)),e.siblings(".um_range_max").val(e.slider("values",1))}function um_get_search(e){return e.find(".um-search-line").length?e.find(".um-search-line").val():""}function um_get_sort(e){return e.data("sorting")}function um_get_current_page(e){var r=e.data("page");return r&&void 0!==r||(r=1),r}function um_time_convert(e,r){var t=Math.floor(e/60),a=e%60;return 60<=a&&(a=0,24<=(t+=1)&&(t=0)),a<10&&(a="0"+a),t+":"+a}function um_ajax_get_members(s,t){var a=um_members_get_hash(s),e=um_get_current_page(s),r=um_get_search(s),i=um_get_sort(s),m=-(new Date).getTimezoneOffset()/60,_={directory_id:a,page:e,search:r,sorting:i,gmt_offset:m,post_refferer:s.data("base-post"),nonce:um_scripts.nonce};s.find(".um-search-filter").length&&s.find(".um-search-filter").each(function(){var e=jQuery(this);if(e.find(".um-slider").length){var r=e.find(".um-slider").data("field_name"),t=um_get_data_for_directory(s,"filter_"+r+"_from"),a=um_get_data_for_directory(s,"filter_"+r+"_to");void 0===t&&void 0===a||(_[r]=[t,a])}else if(e.find(".um-datepicker-filter").length){r=e.find(".um-datepicker-filter").data("filter_name"),t=um_get_data_for_directory(s,"filter_"+r+"_from"),a=um_get_data_for_directory(s,"filter_"+r+"_to");void 0===t&&void 0===a||(_[r]=[t,a])}else if(e.find(".um-timepicker-filter").length){r=e.find(".um-timepicker-filter").data("filter_name"),t=um_get_data_for_directory(s,"filter_"+r+"_from"),a=um_get_data_for_directory(s,"filter_"+r+"_to");if(void 0!==t)(i=1*(t=t.split(":"))[0])<10&&(i="0"+i),(d=1*t[1])<10&&(d="0"+d),t=i+":"+d+":00";if(void 0!==a){var i,m=a.split(":"),d=1*m[1];(i=1*m[0])<10&&(i="0"+i),d<10&&(d="0"+d),a=i+":"+d+":59"}void 0===t&&void 0===a||(_[r]=[t,a])}else if(e.find("select").length){r=e.find("select").attr("name");void 0!==(u=um_get_data_for_directory(s,"filter_"+r))&&(_[r]=u.split("||"))}else{var u;r=e.find('input[type="text"]').attr("name");void 0!==(u=um_get_data_for_directory(s,"filter_"+r))&&(_[r]=u)}}),_=wp.hooks.applyFilters("um_member_directory_filter_request",_),wp.ajax.send("um_get_members",{data:_,success:function(e){um_member_directory_last_data[a]=e,um_build_template(s,e);var r=wp.template("um-members-pagination");s.find(".um-members-pagination-box").html(r(e)),s.data("total_pages",e.pagination.total_pages),e.pagination.total_pages?(s.find(".um-member-directory-sorting-options").prop("disabled",!1),s.find(".um-member-directory-view-type").removeClass("um-disabled")):(s.find(".um-member-directory-sorting-options").prop("disabled",!0),s.find(".um-member-directory-view-type").addClass("um-disabled")),jQuery(document).trigger("um_members_rendered",t),um_init_new_dropdown(),um_members_hide_preloader(s)},error:function(e){console.log(e),um_members_hide_preloader(s)}})}function um_build_template(e,r){var t=e.data("view_type"),a=wp.template("um-member-"+t+"-"+um_members_get_hash(e));e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-members-wrapper").prepend(a(r.users));var i=wp.template("um-members-header");e.find(".um-members-intro").remove(),void 0!==r.is_search&&r.is_search&&e.find(".um-members-wrapper").prepend(i(r)),e.addClass("um-loaded"),e.find(".um-members.um-members-grid").length&&UM_Member_Grid(e.find(".um-members.um-members-grid")),jQuery(document).trigger("um_build_template",[e,r]),jQuery(window).trigger("resize"),init_tipsy()}function UM_Member_Grid(e){e.find(".um-member").length&&e.imagesLoaded(function(){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"}).on("layoutComplete",function(e,r){jQuery(document).trigger("um_grid_initialized",[e,r])})})}function um_get_filters_data(s){var _=[];return s.find(".um-search-filter").each(function(){var t,a,d,i=jQuery(this);if(i.find("input.um-datepicker-filter").length)d="datepicker",i.find("input.um-datepicker-filter").each(function(){if("to"!==jQuery(this).data("range")){var e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(s,"filter_"+e+"_from"),t=um_get_data_for_directory(s,"filter_"+e+"_to");if(void 0!==r||void 0!==t){var a,i=jQuery(this).val(),m=s.find('input.um-datepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val();i===m?a=m:""!==i&&""!==m?a=i+" - "+m:""===i?a="before "+m:""===m&&(a="since "+i),_.push({name:e,label:jQuery(this).data("filter-label"),value_label:a,value:[r,t],type:d})}}});else if(i.find("input.um-timepicker-filter").length)d="timepicker",i.find("input.um-timepicker-filter").each(function(){if("to"!==jQuery(this).data("range")){var e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(s,"filter_"+e+"_from"),t=um_get_data_for_directory(s,"filter_"+e+"_to");if(void 0!==r||void 0!==t){var a,i=jQuery(this).val(),m=s.find('input.um-timepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val();i===m?a=m:""!==i&&""!==m?a=i+" - "+m:""===i?a="before "+m:""===m&&(a="since "+i),_.push({name:e,label:jQuery(this).data("filter-label"),value_label:a,value:[r,t],type:d})}}});else if(i.find("select").length){d="select",t=i.find("select").attr("name"),a=i.find("select").data("placeholder"),m=void 0===(m=um_get_data_for_directory(s,"filter_"+t))?[]:m.split("||"),jQuery.each(m,function(e){var r=i.find('select option[value="'+m[e]+'"]').data("value_label");_.push({name:t,label:a,value_label:r,value:m[e],type:d})})}else if(i.find('input[type="text"]').length){var m;d="text",t=i.find('input[type="text"]').attr("name"),a=i.find('input[type="text"]').attr("placeholder"),void 0===(m=um_get_data_for_directory(s,"filter_"+t))&&(m=""),""!=m&&_.push({name:t,label:a,value_label:m,value:m,type:d})}else if(i.find("div.ui-slider").length){d="slider",t=i.find("div.ui-slider").data("field_name");var e=um_get_data_for_directory(s,"filter_"+t+"_from"),r=um_get_data_for_directory(s,"filter_"+t+"_to");if(void 0===e&&void 0===r)return;a=i.find("div.um-slider-range").data("label");var u=i.find("div.um-slider-range").data("placeholder").replace("{min_range}",e).replace("{max_range}",r).replace("{field_label}",i.find("div.um-slider-range").data("label"));_.push({name:t,label:a,value_label:u,value:[e,r],type:d})}}),_}function um_change_tag(e){var r=um_get_filters_data(e);e.find(".um-members-filter-tag").remove();var t=e.find(".um-filtered-line");if(t.length){var a=wp.template("um-members-filtered-line");t.prepend(a({filters:r})),0===e.find(".um-members-filter-remove").length?(e.find(".um-clear-filters").hide(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").addClass("um-header-row-invisible")):(e.find(".um-clear-filters").show(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").removeClass("um-header-row-invisible"))}}function um_run_search(e){if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=um_get_data_for_directory(e,"search");if((t=e.find(".um-search-line").val())===r||""===t&&void 0===r)um_members_hide_preloader(e);else{if(e.data("general_search",t),um_set_url_from_data(e,"search",t),e.data("page",1),um_set_url_from_data(e,"page",""),1===e.data("must-search")){var t=um_get_search(e);if(0===e.find(".um-members-filter-remove").length&&!t)return e.data("searched",0),e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-member-directory-sorting-options").prop("disabled",!0),e.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(e)}e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(e)}}}jQuery(document.body).ready(function(){jQuery(".um-directory .um-search-filter select").each(function(){1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),jQuery(this).select2("destroy").select2()}),jQuery(document.body).on("mouseover",".um-directory .um-member-directory-view-type",function(){if(!jQuery(this).hasClass("um-disabled")){var e=jQuery(this).find(".um-member-directory-view-type-a:visible");e.hide(),e.next().length?e.next().show().tipsy("show"):jQuery(this).find(".um-member-directory-view-type-a:first").show().tipsy("show")}}).on("mouseout",".um-directory .um-member-directory-view-type",function(){jQuery(this).hasClass("um-disabled")||(jQuery(this).find(".um-member-directory-view-type-a").hide().tipsy("hide"),jQuery(this).find('.um-member-directory-view-type-a[data-type="'+jQuery(this).parents(".um-directory").data("view_type")+'"]').show())}),jQuery(document.body).on("click",".um-directory .um-member-directory-view-type-a",function(){var e=jQuery(this).parents(".um-directory");if(um_is_directory_busy(e))return!1;var r=jQuery(this),t=r.parents(".um-member-directory-view-type");if(!t.hasClass("um-disabled")){um_members_show_preloader(e);var a=t.find(".um-member-directory-view-type-a:visible");a.hide(),a.next().length?a.next().show().tipsy("show"):t.find(".um-member-directory-view-type-a:first").show().tipsy("show");var i=um_member_directory_last_data[um_members_get_hash(e)];if(null!==i){var m=r.data("type");um_set_url_from_data(e,"view_type",m),e.data("view_type",m),um_build_template(e,i)}um_members_hide_preloader(e)}}),jQuery(document.body).on("click",".um-directory .um-do-search",function(){um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("keypress",".um-directory .um-search-line",function(e){13===e.which&&um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("click",".um-directory .um-member-directory-sorting-a .um-new-dropdown li a",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&1!==jQuery(this).data("selected")){um_members_show_preloader(e);var r=jQuery(this).data("value");e.data("sorting",r),um_set_url_from_data(e,"sort",r),um_ajax_get_members(e),jQuery(this).parents(".um-new-dropdown").find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),jQuery(this).data("selected",1).prop("data-selected",1).attr("data-selected",1),jQuery(this).parents(".um-member-directory-sorting-a").find("> a").html(jQuery(this).html())}}),jQuery(document.body).on("click",".um-directory .pagi:not(.current)",function(){if(!jQuery(this).hasClass("disabled")){var e,r=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(r))um_members_show_preloader(r),1===(e="first"===jQuery(this).data("page")?1:"prev"===jQuery(this).data("page")?1*r.data("page")-1:"next"===jQuery(this).data("page")?1*r.data("page")+1:"last"===jQuery(this).data("page")?parseInt(r.data("total_pages")):parseInt(jQuery(this).data("page")))?(r.find('.pagi[data-page="first"], .pagi[data-page="prev"]').addClass("disabled"),r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled")):(e===parseInt(r.data("total_pages"))?r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').addClass("disabled"):r.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled"),r.find('.pagi[data-page="first"], .pagi[data-page="prev"]').removeClass("disabled")),r.find(".pagi").removeClass("current"),r.find('.pagi[data-page="'+e+'"]').addClass("current"),r.data("page",e),um_set_url_from_data(r,"page",1===e?"":e),um_ajax_get_members(r)}}),jQuery(document.body).on("change",".um-directory .um-members-pagi-dropdown",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=jQuery(this).val();e.find(".pagi").removeClass("current"),e.find('.pagi[data-page="'+r+'"]').addClass("current"),e.data("page",r),um_set_url_from_data(e,"page",1===r?"":r),um_ajax_get_members(e)}}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-more a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member");return r.find(".um-member-more").hide(),r.find(".um-member-meta-main").slideDown(),r.find(".um-member-less").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member");return r.find(".um-member-less").hide(),r.find(".um-member-meta-main").slideUp(),r.find(".um-member-more").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-more a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-more").hide(),r.find(".um-member-meta").slideDown(function(){UM_Member_Grid(t)}),r.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(t)},100),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-less").hide(),r.find(".um-member-meta").slideUp(function(){r.find(".um-member-more").fadeIn(),UM_Member_Grid(t)}),!1}),jQuery(".um-member-directory-filters-a").click(function(){var e=jQuery(this),r=e.parents(".um-directory").find(".um-search");r.is(":visible")?r.slideUp(250,function(){e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}):r.slideDown({duration:250,start:function(){jQuery(this).css({display:"grid"}),e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}})}),jQuery(document.body).on("change",".um-directory .um-search-filter select",function(){if(""!==jQuery(this).val()){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=jQuery(this).prop("name"),t=um_get_data_for_directory(e,"filter_"+r);t=void 0===t?[]:t.split("||"),-1===jQuery.inArray(jQuery(this).val(),t)&&(t.push(jQuery(this).val()),um_set_url_from_data(e,"filter_"+r,t=t.join("||")),e.data("page",1),um_set_url_from_data(e,"page","")),jQuery(this).find('option[value="'+jQuery(this).val()+'"]').prop("disabled",!0).hide(),1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),jQuery(this).select2("destroy").select2(),jQuery(this).val("").trigger("change"),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled")}}}),jQuery(document.body).on("blur",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)){var r=jQuery(this).val(),t=jQuery(this).prop("name"),a=um_get_data_for_directory(e,"filter_"+t);void 0===a&&(a=""),r!==a&&(um_members_show_preloader(e),um_set_url_from_data(e,"filter_"+t,r),e.data("page",1),um_set_url_from_data(e,"page",""),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"))}}),jQuery(document.body).on("keypress",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(e){if(13===e.which){var r=jQuery(this).parents(".um-directory");if(um_is_directory_busy(r))return;var t=jQuery(this).val(),a=jQuery(this).prop("name"),i=um_get_data_for_directory(r,"filter_"+a);if(void 0===i&&(i=""),t===i)return;um_members_show_preloader(r),um_set_url_from_data(r,"filter_"+a,t),r.data("page",1),um_set_url_from_data(r,"page",""),um_ajax_get_members(r),um_change_tag(r),r.data("searched",1),r.find(".um-member-directory-sorting-options").prop("disabled",!1),r.find(".um-member-directory-view-type").removeClass("um-disabled")}}),jQuery(document.body).on("click",".um-directory .um-members-filter-remove",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&e){um_members_show_preloader(e);var r=jQuery(this).data("value"),t=jQuery(this).data("name"),a=jQuery(this).data("type");if("text"===a)um_set_url_from_data(e,"filter_"+t,""),jQuery('.um-search-filter input[name="'+t+'"]').val("");else if("select"===a){var i=um_get_data_for_directory(e,"filter_"+t);i=void 0===i?[]:i.split("||"),-1!==jQuery.inArray(r.toString(),i)&&(i=jQuery.grep(i,function(e){return e!==r.toString()})),i.length||(i=""),um_set_url_from_data(e,"filter_"+t,i);var m=jQuery('.um-search-filter select[name="'+t+'"]');m.find('option[value="'+r+'"]').prop("disabled",!1).show(),1<m.find("option:not(:disabled)").length&&m.prop("disabled",!1),m.select2("destroy").select2(),0<e.find('.um-search-filter select[data-um-parent="'+t+'"]').length&&m.trigger("change")}else"slider"===a?(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to","")):"datepicker"===a?(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to","")):"timepicker"===a&&(um_set_url_from_data(e,"filter_"+t+"_from",""),um_set_url_from_data(e,"filter_"+t+"_to",""));if(e.data("page",1),um_set_url_from_data(e,"page",""),jQuery(this).tipsy("hide"),jQuery(this).parents(".um-members-filter-tag").remove(),0===e.find(".um-members-filter-remove").length?e.find(".um-clear-filters").hide():e.find(".um-clear-filters").show(),1===e.data("must-search")){var d=um_get_search(e);if(0===e.find(".um-members-filter-remove").length&&!d)return e.data("searched",0),e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-member-directory-sorting-options").prop("disabled",!0),e.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(e)}e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(e)}}),jQuery(document.body).on("click",".um-directory .um-clear-filters-a",function(){var m=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(m)){if(um_members_show_preloader(m),m.find(".um-members-filter-remove").each(function(){var r=jQuery(this).data("value"),e=jQuery(this).data("name"),t=jQuery(this).data("type");if("text"===t)um_set_url_from_data(m,"filter_"+e,""),jQuery('.um-search-filter input[name="'+e+'"]').val("");else if("select"===t){var a=um_get_data_for_directory(m,"filter_"+e);a=void 0===a?[]:a.split("||"),-1!==jQuery.inArray(r.toString(),a)&&(a=jQuery.grep(a,function(e){return e!==r.toString()})),a.length||(a=""),um_set_url_from_data(m,"filter_"+e,a);var i=jQuery('.um-search-filter select[name="'+e+'"]');i.find('option[value="'+r+'"]').prop("disabled",!1).show(),1<i.find("option:not(:disabled)").length&&i.prop("disabled",!1),i.select2("destroy").select2()}else"slider"===t?(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to",""),jQuery('.um-search-filter input[name="filter_'+e+'_from"]').val(""),jQuery('.um-search-filter input[name="filter_'+e+'_to"]').val("")):"datepicker"===t?(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to",""),jQuery('.um-search-filter input[name="filter_'+e+'_from"]').val(""),jQuery('.um-search-filter input[name="filter_'+e+'_to"]').val("")):"timepicker"===t&&(um_set_url_from_data(m,"filter_"+e+"_from",""),um_set_url_from_data(m,"filter_"+e+"_to",""),jQuery('.um-search-filter input[name="filter_'+e+'_from"]').val(""),jQuery('.um-search-filter input[name="filter_'+e+'_to"]').val(""))}),m.data("page",1),um_set_url_from_data(m,"page",""),m.find(".um-members-filter-tag").remove(),0===m.find(".um-members-filter-remove").length?(m.find(".um-clear-filters").hide(),m.find(".um-clear-filters").parents(".um-member-directory-header-row").addClass("um-header-row-invisible")):(m.find(".um-clear-filters").show(),m.find(".um-clear-filters").parents(".um-member-directory-header-row").removeClass("um-header-row-invisible")),1===m.data("must-search"))if(!um_get_search(m))return m.data("searched",0),m.find(".um-members-grid, .um-members-list").remove(),m.find(".um-member-directory-sorting-options").prop("disabled",!0),m.find(".um-member-directory-view-type").addClass("um-disabled"),void um_members_hide_preloader(m);m.find(".um-member-directory-sorting-options").prop("disabled",!1),m.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(m)}}),jQuery(".um-directory").each(function(){var e=jQuery(this),r=um_members_get_hash(e);if(um_member_directories.push(r),e.find(".um-search").length&&(e.find(".um-search").is(":visible")||e.find(".um-search").css({display:"grid"}).slideUp(1)),e.find(".um-slider").each(function(){var e=jQuery(this),t=e.parents(".um-directory"),a=e.data("field_name"),r=um_get_data_for_directory(t,"filter_"+a+"_from"),i=um_get_data_for_directory(t,"filter_"+a+"_to");void 0===r&&(r=parseInt(e.data("min"))),void 0===i&&(i=parseInt(e.data("max")));var m=[r,i];e.slider({range:!0,min:parseInt(e.data("min")),max:parseInt(e.data("max")),values:m,create:function(e,r){},step:1,slide:function(e,r){um_set_range_label(jQuery(this),r)},stop:function(e,r){um_is_directory_busy(t)||(um_set_url_from_data(t,"filter_"+a+"_from",r.values[0]),um_set_url_from_data(t,"filter_"+a+"_to",r.values[1]),t.data("page",1),um_set_url_from_data(t,"page",""),um_ajax_get_members(t),um_change_tag(t),t.data("searched",1),t.find(".um-member-directory-sorting-options").prop("disabled",!1),t.find(".um-member-directory-view-type").removeClass("um-disabled"))}}),um_set_range_label(e)}),e.find(".um-datepicker-filter").each(function(){var u=jQuery(this),s=new Date(1e3*u.data("date_min")),_=new Date(1e3*u.data("date_max")),e=u.pickadate({selectYears:!0,min:s,max:_,formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){u.blur()},onClose:function(){u.blur()},onSet:function(e){var r=u.parents(".um-directory");if(!um_is_directory_busy(r)){um_members_show_preloader(r);var t=u.data("filter_name"),a=u.data("range"),i=um_get_data_for_directory(r,"filter_"+t+"_from"),m=um_get_data_for_directory(r,"filter_"+t+"_to");void 0===i&&(i=s/1e3),void 0===m&&(m=_/1e3);var d=e.select/1e3;u.val();"from"===a?i=d:"to"===a&&(m=d),um_set_url_from_data(r,"filter_"+t+"_from",i),um_set_url_from_data(r,"filter_"+t+"_to",m),r.data("page",1),um_set_url_from_data(r,"page",""),um_ajax_get_members(r),um_change_tag(r),r.data("searched",1),r.find(".um-member-directory-sorting-options").prop("disabled",!1),r.find(".um-member-directory-view-type").removeClass("um-disabled")}}}).pickadate("picker"),r=u.data("filter_name"),t=u.data("range"),a=um_get_data_for_directory(u.parents(".um-directory"),"filter_"+r+"_"+t);void 0!==a&&e.set("select",1e3*a)}),e.find(".um-timepicker-filter").each(function(){var s=jQuery(this),_=s.attr("id"),o=s.data("filter_name"),n=s.attr("data-min"),l=s.attr("data-max"),e=n.split(":"),r=l.split(":"),t=s.pickatime({format:s.data("format"),interval:parseInt(s.data("intervals")),min:[e[0],e[1]],max:[r[0],r[1]],formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){s.blur()},onClose:function(){s.blur()},onSet:function(e){var r=s.parents(".um-directory");if(!um_is_directory_busy(r)){um_members_show_preloader(r);var t=s.data("filter_name"),a=s.data("range"),i=um_get_data_for_directory(r,"filter_"+t+"_from"),m=um_get_data_for_directory(r,"filter_"+t+"_to");if(void 0===i&&(i=n),void 0===m&&(m=l),void 0!==e.select){var d=um_time_convert(e.select,a);"from"===a?i=d:"to"===a&&(m=d)}else"from"===a?i=n:"to"===a&&(m=l);var u=jQuery("#"+_).val();"from"===s.data("range")?jQuery("#"+o+"_to").pickatime("picker").set("min",u):jQuery("#"+o+"_from").pickatime("picker").set("max",u),um_set_url_from_data(r,"filter_"+t+"_from",i),um_set_url_from_data(r,"filter_"+t+"_to",m),r.data("page",1),um_set_url_from_data(r,"page",""),um_ajax_get_members(r),um_change_tag(r),r.data("searched",1),r.find(".um-member-directory-sorting-options").prop("disabled",!1),r.find(".um-member-directory-view-type").removeClass("um-disabled")}}}).pickatime("picker"),a=s.data("filter_name"),i=s.data("range"),m=um_get_data_for_directory(s.parents(".um-directory"),"filter_"+a+"_"+i);if(void 0!==m){var d=m.split(":");t.set("select",60*d[0]+1*d[1])}}),1===e.data("must-search")){var t=um_get_search(e);if(!um_get_filters_data(e).length&&!t)return}um_members_show_preloader(e),um_ajax_get_members(e,{first_load:!0}),um_change_tag(e)}),window.addEventListener("popstate",function(e){jQuery(".um-directory").each(function(){var d=jQuery(this),e=um_members_get_hash(d);(um_member_directories.push(e),um_members_show_preloader(d),d.find(".um-members-grid, .um-members-list, .um-members-intro").remove(),d.find(".um-member-directory-search-line").length)&&(void 0===(m=um_get_data_for_directory(d,"search"))&&(m=""),d.data("general_search",m),d.find(".um-search-line").val(m));var r=um_get_data_for_directory(d,"page");if(void 0===r?r=1:r>d.data("total_pages")&&(r=d.data("total_pages")),d.data("page",r).attr("data-page",r),d.find(".um-member-directory-sorting").length){var t=um_get_data_for_directory(d,"sort");void 0===t&&(t=d.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]').find('a[data-default="1"]').data("value")),d.data("sorting",t);var a=d.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]');a.find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),a.find('a[data-value="'+t+'"]').data("selected",1).prop("data-selected",1).attr("data-selected",1),d.find(".um-member-directory-sorting-a").find("> a").html(a.find('a[data-value="'+t+'"]').html())}if(d.find(".um-member-directory-view-type").length){var i=um_get_data_for_directory(d,"view_type");void 0===i&&(i=d.find('.um-member-directory-view-type-a[data-default="1"]').data("type")),d.data("view_type",i),d.find(".um-member-directory-view-type .um-member-directory-view-type-a").hide(),d.find('.um-member-directory-view-type .um-member-directory-view-type-a[data-type="'+i+'"]').show()}if(d.find(".um-datepicker-filter").each(function(){var e=jQuery(this),r=e.pickadate("picker"),t=e.data("filter_name"),a=e.data("range"),i=um_get_data_for_directory(d,"filter_"+t+"_"+a);void 0!==i?r.set("select",1e3*i):r.clear()}),d.find(".um-slider").each(function(){var e=jQuery(this),r=e.data("field_name"),t=um_get_data_for_directory(d,"filter_"+r+"_from"),a=um_get_data_for_directory(d,"filter_"+r+"_to");void 0===t&&(t=e.data("min")),t=parseInt(t),void 0===a&&(a=e.data("max")),a=parseInt(a),e.slider("values",[t,a]),um_set_range_label(e)}),d.find(".um-timepicker-filter").each(function(){var e=jQuery(this),r=e.pickatime("picker"),t=e.data("filter_name"),a=e.data("range"),i=um_get_data_for_directory(d,"filter_"+t+"_"+a);if(void 0!==i){var m=i.split(":");r.set("select",60*m[0])}else r.clear()}),1===d.data("must-search")){var m=um_get_search(d);if(!um_get_filters_data(d).length&&!m)return d.data("searched",0),void um_members_hide_preloader(d);d.data("searched",1)}um_ajax_get_members(d),um_change_tag(d)})})});
assets/js/um-scripts.js CHANGED
@@ -465,22 +465,31 @@ jQuery(document).ready(function() {
465
/**
466
* Find all select fields with parent select fields
467
*/
468
- jQuery('select[data-um-parent]').each(function(){
469
470
var me = jQuery(this);
471
var parent_option = me.data('um-parent');
472
- var um_ajax_url = me.data('um-ajax-url');
473
var um_ajax_source = me.data('um-ajax-source');
474
var original_value = me.val();
475
476
me.attr('data-um-init-field', true );
477
478
- jQuery(document).on('change','select[name="'+parent_option+'"]',function(){
479
var parent = jQuery(this);
480
- var form_id = parent.closest('form').find('input[type="hidden"][name="form_id"]').val();
481
- var arr_key = parent.val();
482
483
- if ( parent.val() != '' && typeof um_select_options_cache[ arr_key ] != 'object' ) {
484
485
jQuery.ajax({
486
url: wp.ajax.settings.url,
@@ -488,19 +497,19 @@ jQuery(document).ready(function() {
488
data: {
489
action: 'um_select_options',
490
parent_option_name: parent_option,
491
- parent_option: parent.val(),
492
child_callback: um_ajax_source,
493
- child_name: me.attr('name'),
494
- members_directory: me.attr('data-mebers-directory'),
495
form_id: form_id,
496
nonce: um_scripts.nonce
497
},
498
success: function( data ){
499
- if( data.status == 'success' && parent.val() != '' ){
500
- um_field_populate_child_options( me, data, arr_key);
501
}
502
503
- if( typeof data.debug !== 'undefined' ){
504
console.log( data );
505
}
506
},
@@ -512,19 +521,19 @@ jQuery(document).ready(function() {
512
513
}
514
515
- if ( parent.val() != '' && typeof um_select_options_cache[ arr_key ] == 'object' ) {
516
var data = um_select_options_cache[ arr_key ];
517
um_field_populate_child_options( me, data, arr_key );
518
}
519
520
- if ( parent.val() == '' ){
521
me.find('option[value!=""]').remove();
522
me.val('').trigger('change');
523
}
524
525
});
526
527
- jQuery('select[name="'+parent_option+'"]').trigger('change');
528
529
});
530
@@ -535,6 +544,7 @@ jQuery(document).ready(function() {
535
* @param string key
536
*/
537
function um_field_populate_child_options( me, data, arr_key, arr_items ) {
538
var parent_option = me.data('um-parent');
539
var child_name = me.attr('name');
540
var parent_dom = jQuery('select[name="'+parent_option+'"]');
@@ -548,11 +558,10 @@ jQuery(document).ready(function() {
548
search_get = '';
549
550
if ( data.post.members_directory === 'yes' ) {
551
- var urlParams = new URLSearchParams(window.location.search);
552
- search_get = urlParams.get(data.post.child_name);
553
}
554
jQuery.each( data.items, function(k,v){
555
- arr_items.push({id: k, text: v, selected: (v === search_get) });
556
});
557
558
me.select2('destroy');
@@ -562,6 +571,41 @@ jQuery(document).ready(function() {
562
minimumResultsForSearch: 10
563
});
564
565
if ( data.post.members_directory !== 'yes' ) {
566
if ( typeof data.field.default !== 'undefined' && ! me.data('um-original-value') ) {
567
me.val( data.field.default ).trigger('change');
@@ -576,7 +620,6 @@ jQuery(document).ready(function() {
576
}
577
um_select_options_cache[ arr_key ] = data;
578
579
-
580
}
581
582
});
465
/**
466
* Find all select fields with parent select fields
467
*/
468
+ jQuery('select[data-um-parent]').each( function() {
469
470
var me = jQuery(this);
471
var parent_option = me.data('um-parent');
472
var um_ajax_source = me.data('um-ajax-source');
473
var original_value = me.val();
474
475
me.attr('data-um-init-field', true );
476
477
+ jQuery(document).on('change','select[name="' + parent_option + '"]',function() {
478
var parent = jQuery(this);
479
+ var form_id = parent.closest( 'form' ).find( 'input[type="hidden"][name="form_id"]' ).val();
480
+
481
+ var arr_key;
482
+ if ( me.attr( 'data-member-directory' ) === 'yes' ) {
483
+ var directory = parent.parents('.um-directory');
484
+ arr_key = um_get_data_for_directory( directory, 'filter_' + parent_option );
485
+ if ( typeof arr_key != 'undefined' ) {
486
+ arr_key = arr_key.split('||');
487
+ }
488
+ } else {
489
+ arr_key = parent.val();
490
+ }
491
492
+ if ( typeof arr_key != 'undefined' && arr_key != '' && typeof um_select_options_cache[ arr_key ] != 'object' ) {
493
494
jQuery.ajax({
495
url: wp.ajax.settings.url,
497
data: {
498
action: 'um_select_options',
499
parent_option_name: parent_option,
500
+ parent_option: arr_key,
501
child_callback: um_ajax_source,
502
+ child_name: me.attr('name'),
503
+ members_directory: me.attr('data-member-directory'),
504
form_id: form_id,
505
nonce: um_scripts.nonce
506
},
507
success: function( data ){
508
+ if ( data.status == 'success' && arr_key != '' ) {
509
+ um_field_populate_child_options( me, data, arr_key );
510
}
511
512
+ if ( typeof data.debug !== 'undefined' ) {
513
console.log( data );
514
}
515
},
521
522
}
523
524
+ if ( typeof arr_key != 'undefined' && arr_key != '' && typeof um_select_options_cache[ arr_key ] == 'object' ) {
525
var data = um_select_options_cache[ arr_key ];
526
um_field_populate_child_options( me, data, arr_key );
527
}
528
529
+ if ( typeof arr_key != 'undefined' || arr_key == '' ) {
530
me.find('option[value!=""]').remove();
531
me.val('').trigger('change');
532
}
533
534
});
535
536
+ jQuery('select[name="' + parent_option + '"]').trigger('change');
537
538
});
539
544
* @param string key
545
*/
546
function um_field_populate_child_options( me, data, arr_key, arr_items ) {
547
+ var directory = me.parents('.um-directory');
548
var parent_option = me.data('um-parent');
549
var child_name = me.attr('name');
550
var parent_dom = jQuery('select[name="'+parent_option+'"]');
558
search_get = '';
559
560
if ( data.post.members_directory === 'yes' ) {
561
+ arr_items.push({id: '', text: '', selected: 1});
562
}
563
jQuery.each( data.items, function(k,v){
564
+ arr_items.push({id: k, text: v, selected: (v === search_get)});
565
});
566
567
me.select2('destroy');
571
minimumResultsForSearch: 10
572
});
573
574
+ if ( data.post.members_directory === 'yes' ) {
575
+ me.find('option').each( function() {
576
+ if ( jQuery(this).html() !== '' ) {
577
+ jQuery(this).data( 'value_label', jQuery(this).html() ).attr( 'data-value_label', jQuery(this).html() );
578
+ }
579
+ });
580
+
581
+ var current_filter_val = um_get_data_for_directory( directory, 'filter_' + child_name );
582
+ if ( typeof current_filter_val != 'undefined' ) {
583
+ current_filter_val = current_filter_val.split('||');
584
+
585
+ var temp_filter_val = [];
586
+ jQuery.each( current_filter_val, function(i) {
587
+ if ( me.find('option[value="' + current_filter_val[ i ] + '"]').length ) {
588
+ temp_filter_val.push( current_filter_val[ i ] );
589
+ }
590
+ me.find('option[value="' + current_filter_val[ i ] + '"]').prop('disabled', true).hide();
591
+ if ( me.find('option:not(:disabled)').length === 1 ) {
592
+ me.prop('disabled', true);
593
+ }
594
+
595
+ me.select2('destroy').select2();
596
+ me.val('').trigger( 'change' );
597
+ });
598
+
599
+ temp_filter_val = temp_filter_val.join('||');
600
+ if ( current_filter_val !== temp_filter_val ) {
601
+ um_set_url_from_data( directory, 'filter_' + child_name, temp_filter_val );
602
+ um_ajax_get_members( directory );
603
+ }
604
+ }
605
+
606
+ um_change_tag( directory );
607
+ }
608
+
609
if ( data.post.members_directory !== 'yes' ) {
610
if ( typeof data.field.default !== 'undefined' && ! me.data('um-original-value') ) {
611
me.val( data.field.default ).trigger('change');
620
}
621
um_select_options_cache[ arr_key ] = data;
622
623
}
624
625
});
assets/js/um-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function um_init_datetimepicker(){jQuery(".um-datepicker:not(.picker__input)").each(function(){if(elem=jQuery(this),void 0!==elem.attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else e=!1;var t=null;void 0!==elem.attr("data-years")&&(t=elem.attr("data-years"));var a=elem.attr("data-date_min"),i=elem.attr("data-date_max"),r=[],n=[];void 0!==a&&(r=a.split(",")),void 0!==i&&(n=i.split(","));var u=r.length?new Date(r):null,s=r.length?new Date(n):null;if(u&&"Invalid Date"==u.toString()&&3==r.length){var o=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(o))}if(s&&"Invalid Date"==s.toString()&&3==n.length){var d=n[1]+"/"+n[2]+"/"+n[0];s=new Date(Date.parse(d))}var l={disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}};null!==t&&(l.selectYears=t),null!==u&&(l.min=u),null!==s&&(l.max=s),elem.pickadate(l)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){elem=jQuery(this),elem.pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}function init_tipsy(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))}jQuery(document).ready(function(){jQuery(document.body).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document.body).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),jQuery(this).find(".um-dropdown").show(),!1}),jQuery(document.body).on("click",".um-dropdown-hide",function(e){return UM_hide_menus(),!1}),jQuery(document.body).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");return jQuery(this).parents(t).find(e).trigger("click"),UM_hide_menus(),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),"function"==typeof jQuery.fn.select2&&(jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(".um-s3").select2({allowClear:!1,minimumResultsForSearch:-1})),init_tipsy(),"function"==typeof jQuery.fn.um_raty&&(jQuery(".um-rating").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_apply_conditions(jQuery(this),!1)}}),jQuery(".um-rating-readonly").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0})),jQuery(document).on("change",'.um-field-area input[type="radio"]',function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeAttr("class").addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeAttr("class").addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",'.um-field-area input[type="checkbox"]',function(){jQuery(this).parents(".um-field-area");var e=jQuery(this).parents("label");e.hasClass("active")?(e.removeClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline"))}),um_init_datetimepicker(),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a,nonce:um_scripts.nonce}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a,nonce:um_scripts.nonce}}),!1}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),0<t&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),a=t.data("max_entries");return 1<t.find(".um-field-group-body").length?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),0<a&&t.find(".um-field-group-body").length<a&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document.body).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this),a=jQuery(this).parent();a.addClass("loading");var i=jQuery(this).data("hook");if("um_load_posts"===i){var r=1*jQuery(this).data("pages"),n=1*jQuery(this).data("page")+1;jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate_posts",author:jQuery(this).data("author"),page:n,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.before(e),n===r?a.remove():t.data("page",n)}})}else if("um_load_comments"===i){r=1*jQuery(this).data("pages"),n=1*jQuery(this).data("page")+1;jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate_comments",user_id:jQuery(this).data("user_id"),page:n,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.before(e),n===r?a.remove():t.data("page",n)}})}else{var u=jQuery(this).data("args"),s=jQuery(this).parents(".um").find(".um-ajax-items");jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate",hook:i,args:u,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.remove(),s.append(e)}})}}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),a=jQuery(this).data("user_id"),arguments=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_muted_action",hook:t,user_id:a,arguments:arguments,nonce:um_scripts.nonce},success:function(e){}}),!1}),jQuery(document.body).on("click","#um-search-button",function(){var e=jQuery(this).parents(".um-search-form").data("members_page"),t=[];jQuery(this).parents(".um-search-form").find('input[name="um-search-keys[]"]').each(function(){t.push(jQuery(this).val())});var a,i=jQuery(this).parents(".um-search-form").find(".um-search-field").val();if(""===i)a=e;else{for(var r="?",n=0;n<t.length;n++)r+=t[n]+"="+i,n!==t.length-1&&(r+="&");a=e+r}window.location=a}),jQuery(document.body).on("keypress",".um-search-field",function(e){if(13===e.which){var t=jQuery(this).parents(".um-search-form").data("members_page"),a=[];jQuery(this).parents(".um-search-form").find('input[name="um-search-keys[]"]').each(function(){a.push(jQuery(this).val())});var i,r=jQuery(this).val();if(""===r)i=t;else{for(var n="?",u=0;u<a.length;u++)n+=a[u]+"="+r,u!==a.length-1&&(n+="&");i=t+n}window.location=i}}),jQuery('.um-form input[class="um-button"][type="submit"]').removeAttr("disabled"),jQuery(document).one("click",'.um:not(.um-account) .um-form input[class="um-button"][type="submit"]:not(.um-has-recaptcha)',function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parents("form").submit()});var s={};function o(e,t,a,i){var r=e.data("um-parent");e.attr("name"),jQuery('select[name="'+r+'"]');e.find('option[value!=""]').remove(),e.hasClass("um-child-option-disabled")||e.removeAttr("disabled");i=[];var n="";if("yes"===t.post.members_directory){var u=new URLSearchParams(window.location.search);n=u.get(t.post.child_name)}jQuery.each(t.items,function(e,t){i.push({id:e,text:t,selected:t===n})}),e.select2("destroy"),e.select2({data:i,allowClear:!0,minimumResultsForSearch:10}),"yes"!==t.post.members_directory&&(void 0===t.field.default||e.data("um-original-value")?""!=e.data("um-original-value")&&e.val(e.data("um-original-value")).trigger("change"):e.val(t.field.default).trigger("change"),0==t.field.editable&&(e.addClass("um-child-option-disabled"),e.attr("disabled","disabled"))),s[a]=t}jQuery("select[data-um-parent]").each(function(){var r=jQuery(this),n=r.data("um-parent"),u=(r.data("um-ajax-url"),r.data("um-ajax-source"));r.val();r.attr("data-um-init-field",!0),jQuery(document).on("change",'select[name="'+n+'"]',function(){var t=jQuery(this),e=t.closest("form").find('input[type="hidden"][name="form_id"]').val(),a=t.val();if(""!=t.val()&&"object"!=typeof s[a]&&jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_select_options",parent_option_name:n,parent_option:t.val(),child_callback:u,child_name:r.attr("name"),members_directory:r.attr("data-mebers-directory"),form_id:e,nonce:um_scripts.nonce},success:function(e){"success"==e.status&&""!=t.val()&&o(r,e,a),void 0!==e.debug&&console.log(e)},error:function(e){console.log(e)}}),""!=t.val()&&"object"==typeof s[a]){var i=s[a];o(r,i,a)}""==t.val()&&(r.find('option[value!=""]').remove(),r.val("").trigger("change"))}),jQuery('select[name="'+n+'"]').trigger("change")})});
1
+ function um_init_datetimepicker(){jQuery(".um-datepicker:not(.picker__input)").each(function(){if(elem=jQuery(this),void 0!==elem.attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else e=!1;var t=null;void 0!==elem.attr("data-years")&&(t=elem.attr("data-years"));var a=elem.attr("data-date_min"),i=elem.attr("data-date_max"),r=[],n=[];void 0!==a&&(r=a.split(",")),void 0!==i&&(n=i.split(","));var u=r.length?new Date(r):null,o=r.length?new Date(n):null;if(u&&"Invalid Date"==u.toString()&&3==r.length){var s=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(s))}if(o&&"Invalid Date"==o.toString()&&3==n.length){var d=n[1]+"/"+n[2]+"/"+n[0];o=new Date(Date.parse(d))}var l={disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}};null!==t&&(l.selectYears=t),null!==u&&(l.min=u),null!==o&&(l.max=o),elem.pickadate(l)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){elem=jQuery(this),elem.pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}function init_tipsy(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))}jQuery(document).ready(function(){jQuery(document.body).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document.body).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),jQuery(this).find(".um-dropdown").show(),!1}),jQuery(document.body).on("click",".um-dropdown-hide",function(e){return UM_hide_menus(),!1}),jQuery(document.body).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");return jQuery(this).parents(t).find(e).trigger("click"),UM_hide_menus(),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),"function"==typeof jQuery.fn.select2&&(jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(".um-s3").select2({allowClear:!1,minimumResultsForSearch:-1})),init_tipsy(),"function"==typeof jQuery.fn.um_raty&&(jQuery(".um-rating").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_apply_conditions(jQuery(this),!1)}}),jQuery(".um-rating-readonly").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0})),jQuery(document).on("change",'.um-field-area input[type="radio"]',function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeAttr("class").addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeAttr("class").addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",'.um-field-area input[type="checkbox"]',function(){jQuery(this).parents(".um-field-area");var e=jQuery(this).parents("label");e.hasClass("active")?(e.removeClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline"))}),um_init_datetimepicker(),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a,nonce:um_scripts.nonce}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a,nonce:um_scripts.nonce}}),!1}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),0<t&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),a=t.data("max_entries");return 1<t.find(".um-field-group-body").length?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),0<a&&t.find(".um-field-group-body").length<a&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document.body).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this),a=jQuery(this).parent();a.addClass("loading");var i=jQuery(this).data("hook");if("um_load_posts"===i){var r=1*jQuery(this).data("pages"),n=1*jQuery(this).data("page")+1;jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate_posts",author:jQuery(this).data("author"),page:n,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.before(e),n===r?a.remove():t.data("page",n)}})}else if("um_load_comments"===i){r=1*jQuery(this).data("pages"),n=1*jQuery(this).data("page")+1;jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate_comments",user_id:jQuery(this).data("user_id"),page:n,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.before(e),n===r?a.remove():t.data("page",n)}})}else{var u=jQuery(this).data("args"),o=jQuery(this).parents(".um").find(".um-ajax-items");jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate",hook:i,args:u,nonce:um_scripts.nonce},complete:function(){a.removeClass("loading")},success:function(e){a.remove(),o.append(e)}})}}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),a=jQuery(this).data("user_id"),arguments=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_muted_action",hook:t,user_id:a,arguments:arguments,nonce:um_scripts.nonce},success:function(e){}}),!1}),jQuery(document.body).on("click","#um-search-button",function(){var e=jQuery(this).parents(".um-search-form").data("members_page"),t=[];jQuery(this).parents(".um-search-form").find('input[name="um-search-keys[]"]').each(function(){t.push(jQuery(this).val())});var a,i=jQuery(this).parents(".um-search-form").find(".um-search-field").val();if(""===i)a=e;else{for(var r="?",n=0;n<t.length;n++)r+=t[n]+"="+i,n!==t.length-1&&(r+="&");a=e+r}window.location=a}),jQuery(document.body).on("keypress",".um-search-field",function(e){if(13===e.which){var t=jQuery(this).parents(".um-search-form").data("members_page"),a=[];jQuery(this).parents(".um-search-form").find('input[name="um-search-keys[]"]').each(function(){a.push(jQuery(this).val())});var i,r=jQuery(this).val();if(""===r)i=t;else{for(var n="?",u=0;u<a.length;u++)n+=a[u]+"="+r,u!==a.length-1&&(n+="&");i=t+n}window.location=i}}),jQuery('.um-form input[class="um-button"][type="submit"]').removeAttr("disabled"),jQuery(document).one("click",'.um:not(.um-account) .um-form input[class="um-button"][type="submit"]:not(.um-has-recaptcha)',function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parents("form").submit()});var d={};function s(t,e,a,i){var r=t.parents(".um-directory"),n=t.data("um-parent"),u=t.attr("name");jQuery('select[name="'+n+'"]');t.find('option[value!=""]').remove(),t.hasClass("um-child-option-disabled")||t.removeAttr("disabled");i=[];if("yes"===e.post.members_directory&&i.push({id:"",text:"",selected:1}),jQuery.each(e.items,function(e,t){i.push({id:e,text:t,selected:""===t})}),t.select2("destroy"),t.select2({data:i,allowClear:!0,minimumResultsForSearch:10}),"yes"===e.post.members_directory){t.find("option").each(function(){""!==jQuery(this).html()&&jQuery(this).data("value_label",jQuery(this).html()).attr("data-value_label",jQuery(this).html())});var o=um_get_data_for_directory(r,"filter_"+u);if(void 0!==o){o=o.split("||");var s=[];jQuery.each(o,function(e){t.find('option[value="'+o[e]+'"]').length&&s.push(o[e]),t.find('option[value="'+o[e]+'"]').prop("disabled",!0).hide(),1===t.find("option:not(:disabled)").length&&t.prop("disabled",!0),t.select2("destroy").select2(),t.val("").trigger("change")}),s=s.join("||"),o!==s&&(um_set_url_from_data(r,"filter_"+u,s),um_ajax_get_members(r))}um_change_tag(r)}"yes"!==e.post.members_directory&&(void 0===e.field.default||t.data("um-original-value")?""!=t.data("um-original-value")&&t.val(t.data("um-original-value")).trigger("change"):t.val(e.field.default).trigger("change"),0==e.field.editable&&(t.addClass("um-child-option-disabled"),t.attr("disabled","disabled"))),d[a]=e}jQuery("select[data-um-parent]").each(function(){var n=jQuery(this),u=n.data("um-parent"),o=n.data("um-ajax-source");n.val();n.attr("data-um-init-field",!0),jQuery(document).on("change",'select[name="'+u+'"]',function(){var t,e=jQuery(this),a=e.closest("form").find('input[type="hidden"][name="form_id"]').val();if("yes"===n.attr("data-member-directory")){var i=e.parents(".um-directory");void 0!==(t=um_get_data_for_directory(i,"filter_"+u))&&(t=t.split("||"))}else t=e.val();if(void 0!==t&&""!=t&&"object"!=typeof d[t]&&jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_select_options",parent_option_name:u,parent_option:t,child_callback:o,child_name:n.attr("name"),members_directory:n.attr("data-member-directory"),form_id:a,nonce:um_scripts.nonce},success:function(e){"success"==e.status&&""!=t&&s(n,e,t),void 0!==e.debug&&console.log(e)},error:function(e){console.log(e)}}),void 0!==t&&""!=t&&"object"==typeof d[t]){var r=d[t];s(n,r,t)}void 0===t&&""!=t||(n.find('option[value!=""]').remove(),n.val("").trigger("change"))}),jQuery('select[name="'+u+'"]').trigger("change")})});
includes/admin/assets/css/um-admin-builder.css CHANGED
@@ -301,4 +301,18 @@
301
background: #fff;
302
box-sizing: border-box;
303
width: 100%;
304
}
301
background: #fff;
302
box-sizing: border-box;
303
width: 100%;
304
+ }
305
+
306
+ .um-admin-preview-overlay {
307
+ position: absolute;
308
+ top:0;
309
+ bottom: 0;
310
+ left: 0;
311
+ right: 0;
312
+ background-color: rgba(255,255,255,0);
313
+ z-index: 100;
314
+ }
315
+
316
+ #UM_preview_form .um-admin-modal-body {
317
+ position: relative;
318
}
includes/admin/assets/css/um-admin-forms.css CHANGED
@@ -64,7 +64,23 @@ textarea.um-forms-field.um-small-field {
64
margin: 5px 0 0 0;
65
}
66
67
- .um-multi-text-option-line .um-field-wrapper,
68
.um-multi-selects-option-line .um-field-wrapper {
69
float:left;
70
width: calc( 100% - 60px );
@@ -72,6 +88,17 @@ textarea.um-forms-field.um-small-field {
72
box-sizing: border-box;
73
}
74
75
.um-md-default-filters-option-line .um-field-wrapper {
76
float:left;
77
width: calc( 100% - 60px );
64
margin: 5px 0 0 0;
65
}
66
67
+ .um-multi-selects-option-line.um-admin-drag-fld {
68
+ background: none;
69
+ border: none;
70
+ display: flex;
71
+ flex-direction: row;
72
+ justify-content: flex-start;
73
+ align-items: center;
74
+ flex-wrap: nowrap;
75
+ }
76
+
77
+ .um-multi-selects-option-line.um-admin-drag-fld .um-field-icon {
78
+ float: left;
79
+ width: 20px;
80
+ text-align: left;
81
+ line-height: 30px;
82
+ }
83
+
84
.um-multi-selects-option-line .um-field-wrapper {
85
float:left;
86
width: calc( 100% - 60px );
88
box-sizing: border-box;
89
}
90
91
+ .um-multi-selects-option-line.um-admin-drag-fld .um-field-wrapper {
92
+ width: calc( 100% - 90px );
93
+ }
94
+
95
+ .um-multi-text-option-line .um-field-wrapper {
96
+ float:left;
97
+ width: calc( 100% - 90px );
98
+ line-height: 30px;
99
+ box-sizing: border-box;
100
+ }
101
+
102
.um-md-default-filters-option-line .um-field-wrapper {
103
float:left;
104
width: calc( 100% - 60px );
includes/admin/assets/js/um-admin-forms.js CHANGED
@@ -1,4 +1,16 @@
1
jQuery(document).ready( function() {
2
/**
3
* Multi-selects field
4
*/
@@ -16,6 +28,8 @@ jQuery(document).ready( function() {
16
jQuery( '.um-multi-selects-add-option' ).click( function() {
17
var list = jQuery(this).siblings('ul.um-multi-selects-list');
18
19
var field_id = list.data('field_id');
20
var k = 0;
21
if ( list.find( 'li:last select.um-forms-field' ).length > 0 ) {
@@ -25,14 +39,20 @@ jQuery(document).ready( function() {
25
26
var selector_html = jQuery( '<div>' ).append( list.siblings('.um-hidden-multi-selects').clone() ).html();
27
28
- list.append(
29
- '<li class="um-multi-selects-option-line"><span class="um-field-wrapper">' + selector_html +
30
- '</span><span class="um-field-control"><a href="javascript:void(0);" class="um-select-delete">' + php_data.texts.remove + '</a></span></li>'
31
- );
32
33
list.find('li:last .um-hidden-multi-selects').attr('name', jQuery(this).data('name') ).
34
addClass('um-forms-field um-long-field').removeClass('um-hidden-multi-selects').attr('id', list.data('id_attr') + '-' + k);
35
-
36
});
37
38
var um_local_date = new Date();
@@ -284,7 +304,7 @@ jQuery(document).ready( function() {
284
285
list.append(
286
'<li class="um-md-default-filters-option-line"><span class="um-field-wrapper">' + selector_html +
287
- '</span></span><span class="um-field-control"><a href="javascript:void(0);" class="um-select-delete">' + php_data.texts.remove + '</a></span><span class="um-field-wrapper2 um"></li>'
288
);
289
290
list.find('li:last .um-hidden-md-default-filters').attr('name', jQuery(this).data('name') ).
@@ -318,7 +338,7 @@ jQuery(document).ready( function() {
318
319
list.append(
320
'<li class="' + classes + '"><span class="um-field-wrapper">' + text_html +
321
- '</span><span class="um-field-control"><a href="javascript:void(0);" class="um-text-delete">' + php_data.texts.remove + '</a></span></li>'
322
);
323
324
list.find('li:last .um-hidden-multi-text').attr('name', jQuery(this).data('name') ).
@@ -366,7 +386,7 @@ jQuery(document).ready( function() {
366
frame = wp.media({
367
title: button.data('upload_frame'),
368
button: {
369
- text: php_data.texts.select
370
},
371
multiple: false // Set to true to allow multiple files to be selected
372
});
1
jQuery(document).ready( function() {
2
+
3
+
4
+ /**
5
+ * Multi-selects sort
6
+ */
7
+ jQuery('.um-multi-selects-list.um-sortable-multi-selects').sortable({
8
+ items: '.um-admin-drag-fld',
9
+ connectWith: '.um-admin-drag-col,.um-admin-drag-group',
10
+ forcePlaceholderSize: true
11
+ });
12
+
13
+
14
/**
15
* Multi-selects field
16
*/
28
jQuery( '.um-multi-selects-add-option' ).click( function() {
29
var list = jQuery(this).siblings('ul.um-multi-selects-list');
30
31
+ var sortable = list.hasClass( 'um-sortable-multi-selects' );
32
+
33
var field_id = list.data('field_id');
34
var k = 0;
35
if ( list.find( 'li:last select.um-forms-field' ).length > 0 ) {
39
40
var selector_html = jQuery( '<div>' ).append( list.siblings('.um-hidden-multi-selects').clone() ).html();
41
42
+ var html = '<li class="um-multi-selects-option-line' + ( sortable ? ' um-admin-drag-fld' : '' ) + '">';
43
+ if ( sortable ) {
44
+ html += '<span class="um-field-icon"><i class="um-faicon-sort"></i></span>';
45
+ }
46
+
47
+ html += '<span class="um-field-wrapper">' + selector_html + '</span>' +
48
+ '<span class="um-field-control">' +
49
+ '<a href="javascript:void(0);" class="um-select-delete">' + wp.i18n.__( 'Remove', 'ultimate-member' ) + '</a>' +
50
+ '</span>' +
51
+ '</li>';
52
+ list.append( html );
53
54
list.find('li:last .um-hidden-multi-selects').attr('name', jQuery(this).data('name') ).
55
addClass('um-forms-field um-long-field').removeClass('um-hidden-multi-selects').attr('id', list.data('id_attr') + '-' + k);
56
});
57
58
var um_local_date = new Date();
304
305
list.append(
306
'<li class="um-md-default-filters-option-line"><span class="um-field-wrapper">' + selector_html +
307
+ '</span></span><span class="um-field-control"><a href="javascript:void(0);" class="um-select-delete">' + wp.i18n.__( 'Remove', 'ultimate-member' ) + '</a></span><span class="um-field-wrapper2 um"></li>'
308
);
309
310
list.find('li:last .um-hidden-md-default-filters').attr('name', jQuery(this).data('name') ).
338
339
list.append(
340
'<li class="' + classes + '"><span class="um-field-wrapper">' + text_html +
341
+ '</span><span class="um-field-control"><a href="javascript:void(0);" class="um-text-delete">' + wp.i18n.__( 'Remove', 'ultimate-member' ) + '</a></span></li>'
342
);
343
344
list.find('li:last .um-hidden-multi-text').attr('name', jQuery(this).data('name') ).
386
frame = wp.media({
387
title: button.data('upload_frame'),
388
button: {
389
+ text: wp.i18n.__( 'Select', 'ultimate-member' )
390
},
391
multiple: false // Set to true to allow multiple files to be selected
392
});
includes/admin/assets/js/um-admin-modal.js CHANGED
@@ -139,6 +139,11 @@ function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
139
140
}
141
142
um_init_tooltips();
143
144
um_admin_init_datetimepicker();
139
140
}
141
142
+ if ( act_id === 'um_admin_preview_form' ) {
143
+ //fix for overlay in scrollable preview modal
144
+ jQuery('.um-admin-preview-overlay').css('height', jQuery('.um-admin-preview-overlay').siblings('.um').outerHeight(true)*1 + 20 + 'px' );
145
+ }
146
+
147
um_init_tooltips();
148
149
um_admin_init_datetimepicker();
includes/admin/assets/js/um-admin-settings.js CHANGED
@@ -21,7 +21,7 @@ jQuery( document ).ready( function() {
21
jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).click( function() {
22
if ( changed ) {
23
window.onbeforeunload = function() {
24
- return php_data.onbeforeunload_text;
25
};
26
} else {
27
window.onbeforeunload = '';
21
jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).click( function() {
22
if ( changed ) {
23
window.onbeforeunload = function() {
24
+ return wp.i18n.__( 'Are sure, maybe some settings not saved', 'ultimate-member' );
25
};
26
} else {
27
window.onbeforeunload = '';
includes/admin/core/class-admin-builder.php CHANGED
@@ -27,6 +27,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
27
function __construct() {
28
add_action( 'um_admin_field_modal_header', array( &$this, 'add_message_handlers' ) );
29
add_action( 'um_admin_field_modal_footer', array( &$this, 'add_conditional_support' ), 10, 4 );
30
add_filter( 'um_admin_pre_save_field_to_form', array( &$this, 'um_admin_pre_save_field_to_form' ), 1 );
31
add_filter( 'um_admin_pre_save_fields_hook', array( &$this, 'um_admin_pre_save_fields_hook' ), 1 );
32
add_filter( 'um_admin_field_update_error_handling', array( &$this, 'um_admin_field_update_error_handling' ), 1, 2 );
@@ -1053,7 +1054,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
1053
UM()->fields()->editing = true;
1054
}
1055
1056
- $output = do_shortcode('[ultimatemember form_id="' . $arg1 . '" /]');
1057
1058
break;
1059
@@ -1139,6 +1141,24 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
1139
}
1140
1141
1142
/**
1143
* Retrieves dropdown/multi-select options from a callback function
1144
*/
27
function __construct() {
28
add_action( 'um_admin_field_modal_header', array( &$this, 'add_message_handlers' ) );
29
add_action( 'um_admin_field_modal_footer', array( &$this, 'add_conditional_support' ), 10, 4 );
30
+ add_filter( 'um_admin_builder_skip_field_validation', array( &$this, 'skip_field_validation' ), 10, 3 );
31
add_filter( 'um_admin_pre_save_field_to_form', array( &$this, 'um_admin_pre_save_field_to_form' ), 1 );
32
add_filter( 'um_admin_pre_save_fields_hook', array( &$this, 'um_admin_pre_save_fields_hook' ), 1 );
33
add_filter( 'um_admin_field_update_error_handling', array( &$this, 'um_admin_field_update_error_handling' ), 1, 2 );
1054
UM()->fields()->editing = true;
1055
}
1056
1057
+ $output = '<div class="um-admin-preview-overlay"></div>';
1058
+ $output .= do_shortcode('[ultimatemember form_id="' . $arg1 . '" /]');
1059
1060
break;
1061
1141
}
1142
1143
1144
+ /**
1145
+ * Skip field validation for:
1146
+ * - '_options' if Choices Callback specified
1147
+ *
1148
+ * @param boolean $skip
1149
+ * @param string $post_input
1150
+ * @param array $array
1151
+ * @return boolean
1152
+ */
1153
+ public function skip_field_validation( $skip, $post_input, $array ) {
1154
+ if ( $post_input === '_options' && isset( $array['post']['_custom_dropdown_options_source'] ) ) {
1155
+ $skip = function_exists( $array['post']['_custom_dropdown_options_source'] );
1156
+ }
1157
+
1158
+ return $skip;
1159
+ }
1160
+
1161
+
1162
/**
1163
* Retrieves dropdown/multi-select options from a callback function
1164
*/
includes/admin/core/class-admin-enqueue.php CHANGED
@@ -227,17 +227,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
227
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui' ), ultimatemember_version );
228
wp_enqueue_style( 'um_admin_forms' );
229
230
- wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery' ), ultimatemember_version, true );
231
wp_enqueue_script( 'um_admin_forms' );
232
-
233
- $localize_data = array(
234
- 'texts' => array(
235
- 'remove' => __( 'Remove', 'ultimate-member' ),
236
- 'select' => __( 'Select', 'ultimate-member' )
237
- )
238
- );
239
-
240
- wp_localize_script( 'um_admin_forms', 'php_data', $localize_data );
241
}
242
243
@@ -257,18 +248,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
257
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css', array(), ultimatemember_version );
258
wp_enqueue_style( 'um_admin_settings' );
259
260
- wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', array( 'jquery' ), ultimatemember_version, true );
261
wp_enqueue_script( 'um_admin_settings' );
262
-
263
- $localize_data = array(
264
- 'onbeforeunload_text' => __( 'Are sure, maybe some settings not saved', 'ultimate-member' ),
265
- 'texts' => array(
266
- 'remove' => __( 'Remove', 'ultimate-member' ),
267
- 'select' => __( 'Select', 'ultimate-member' )
268
- )
269
- );
270
-
271
- wp_localize_script( 'um_admin_settings', 'php_data', $localize_data );
272
}
273
274
227
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui' ), ultimatemember_version );
228
wp_enqueue_style( 'um_admin_forms' );
229
230
+ wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true );
231
wp_enqueue_script( 'um_admin_forms' );
232
}
233
234
248
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css', array(), ultimatemember_version );
249
wp_enqueue_style( 'um_admin_settings' );
250
251
+ wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true );
252
wp_enqueue_script( 'um_admin_settings' );
253
}
254
255
includes/admin/core/class-admin-forms.php CHANGED
@@ -849,8 +849,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
849
850
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
851
852
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
853
$class .= ! empty( $field_data['size'] ) ? $field_data['size'] : 'um-long-field';
854
$class_attr = ' class="um-forms-field ' . $class . '" ';
855
856
$data = array(
@@ -876,7 +879,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
876
}
877
878
$html = "<select class=\"um-hidden-multi-selects\" $data_attr>$options</select>";
879
- $html .= "<ul class=\"um-multi-selects-list\" $data_attr>";
880
881
if ( ! empty( $values ) && is_array( $values ) ) {
882
foreach ( $values as $k => $value ) {
@@ -892,7 +899,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
892
$options .= '<option value="' . $key . '" ' . selected( $key == $value, true, false ) . '>' . $option . '</option>';
893
}
894
895
- $html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
896
<select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
897
<span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
898
}
@@ -906,7 +917,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
906
$options .= '<option value="' . $key . '">' . $option . '</option>';
907
}
908
909
- $html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
910
<select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
911
<span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
912
849
850
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
851
852
+ $sorting = ! empty( $field_data['sorting'] ) ? $field_data['sorting'] : false;
853
+
854
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
855
$class .= ! empty( $field_data['size'] ) ? $field_data['size'] : 'um-long-field';
856
+ $class .= ! empty( $sorting ) ? 'um-sorting-enabled' : '';
857
$class_attr = ' class="um-forms-field ' . $class . '" ';
858
859
$data = array(
879
}
880
881
$html = "<select class=\"um-hidden-multi-selects\" $data_attr>$options</select>";
882
+ $html .= "<ul class=\"um-multi-selects-list" . ( ! empty( $sorting ) ? ' um-sortable-multi-selects' : '' ) . "\" $data_attr>";
883
+
884
+ if ( $sorting && is_array( $values ) ) {
885
+ ksort( $values );
886
+ }
887
888
if ( ! empty( $values ) && is_array( $values ) ) {
889
foreach ( $values as $k => $value ) {
899
$options .= '<option value="' . $key . '" ' . selected( $key == $value, true, false ) . '>' . $option . '</option>';
900
}
901
902
+ $html .= '<li class="um-multi-selects-option-line' . ( ! empty( $sorting ) ? ' um-admin-drag-fld' : '' ) . '">';
903
+ if ( $sorting ) {
904
+ $html .= '<span class="um-field-icon"><i class="um-faicon-sort"></i></span>';
905
+ }
906
+ $html .= "<span class=\"um-field-wrapper\">
907
<select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
908
<span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
909
}
917
$options .= '<option value="' . $key . '">' . $option . '</option>';
918
}
919
920
+ $html .= '<li class="um-multi-selects-option-line' . ( ! empty( $sorting ) ? ' um-admin-drag-fld' : '' ) . '">';
921
+ if ( $sorting ) {
922
+ $html .= '<span class="um-field-icon"><i class="um-faicon-sort"></i></span>';
923
+ }
924
+
925
+ $html .= "<span class=\"um-field-wrapper\">
926
<select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
927
<span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
928
includes/admin/core/class-admin-notices.php CHANGED
@@ -44,7 +44,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
44
$this->exif_extension_notice();
45
$this->show_update_messages();
46
$this->check_wrong_install_folder();
47
- $this->admin_notice_opt_in();
48
$this->need_upgrade();
49
$this->check_wrong_licenses();
50
@@ -266,7 +266,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
266
$active_plugins = UM()->dependencies()->get_active_plugins();
267
foreach ( $slugs as $slug ) {
268
if ( in_array( $slug, $active_plugins ) ) {
269
- $plugin_data = get_plugin_data( um_path . '..' . DIRECTORY_SEPARATOR . $slug );
270
if ( version_compare( '2.0', $plugin_data['Version'], '>' ) ) {
271
$show = true;
272
break;
44
$this->exif_extension_notice();
45
$this->show_update_messages();
46
$this->check_wrong_install_folder();
47
+ //$this->admin_notice_opt_in();
48
$this->need_upgrade();
49
$this->check_wrong_licenses();
50
266
$active_plugins = UM()->dependencies()->get_active_plugins();
267
foreach ( $slugs as $slug ) {
268
if ( in_array( $slug, $active_plugins ) ) {
269
+ $path = wp_normalize_path( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $slug );
270
+ if ( ! file_exists( $path ) ) {
271
+ continue;
272
+ }
273
+ $plugin_data = get_plugin_data( $path );
274
if ( version_compare( '2.0', $plugin_data['Version'], '>' ) ) {
275
$show = true;
276
break;
includes/admin/core/list-tables/emails-list-table.php CHANGED
@@ -307,7 +307,7 @@ $ListTable->set_columns( $columns );
307
$emails = UM()->config()->email_notifications;
308
309
$ListTable->prepare_items();
310
- $ListTable->items = $emails;
311
$ListTable->wpc_set_pagination_args( array( 'total_items' => count( $emails ), 'per_page' => $per_page ) ); ?>
312
313
<p class="description" style="margin: 20px 0 0 0;">
307
$emails = UM()->config()->email_notifications;
308
309
$ListTable->prepare_items();
310
+ $ListTable->items = array_slice( $emails, ( $paged - 1 ) * $per_page, $per_page );
311
$ListTable->wpc_set_pagination_args( array( 'total_items' => count( $emails ), 'per_page' => $per_page ) ); ?>
312
313
<p class="description" style="margin: 20px 0 0 0;">
includes/admin/core/packages/2.1.0-beta1/member-directory.php CHANGED
@@ -87,6 +87,9 @@ if ( ! empty( $member_directories ) && ! is_wp_error( $member_directories ) ) {
87
update_post_meta( $id, '_um_roles_can_filter', $can_search_roles );
88
update_post_meta( $id, '_um_search_fields', $filter_fields );
89
update_post_meta( $id, '_um_search_fields_old', $search_fields_old );
90
} else {
91
update_post_meta( $id, '_um_search', 0 );
92
update_post_meta( $id, '_um_filters', 0 );
87
update_post_meta( $id, '_um_roles_can_filter', $can_search_roles );
88
update_post_meta( $id, '_um_search_fields', $filter_fields );
89
update_post_meta( $id, '_um_search_fields_old', $search_fields_old );
90
+
91
+ update_post_meta( $id, '_um_filters_expanded', 1 );
92
+ update_post_meta( $id, '_um_filters_is_collapsible', 0 );
93
} else {
94
update_post_meta( $id, '_um_search', 0 );
95
update_post_meta( $id, '_um_filters', 0 );
includes/admin/templates/directory/pagination.php CHANGED
@@ -39,25 +39,27 @@
39
'size' => 'small'
40
),
41
array(
42
- 'id' => '_um_directory_header',
43
- 'type' => 'text',
44
- 'label' => __( 'Results Text', 'ultimate-member' ),
45
- 'tooltip' => __( 'Customize the search result text . e.g. Found 3,000 Members. Leave this blank to not show result text', 'ultimate-member' ),
46
- 'value' => UM()->query()->get_meta_value('_um_directory_header', null, __( '{total_users} Members', 'ultimate-member' ) ),
47
),
48
array(
49
- 'id' => '_um_directory_header_single',
50
- 'type' => 'text',
51
- 'label' => __( 'Single Result Text', 'ultimate-member' ),
52
- 'tooltip' => __( 'Same as above but in case of 1 user found only', 'ultimate-member' ),
53
- 'value' => UM()->query()->get_meta_value('_um_directory_header_single', null, __( '{total_users} Member', 'ultimate-member' ) ),
54
),
55
array(
56
- 'id' => '_um_directory_no_users',
57
- 'type' => 'text',
58
- 'label' => __( 'Custom text if no users were found', 'ultimate-member' ),
59
- 'tooltip' => __( 'This is the text that is displayed if no users are found during a search', 'ultimate-member' ),
60
- 'value' => UM()->query()->get_meta_value('_um_directory_no_users', null, __( 'We are sorry. We cannot find any users who match your search criteria.', 'ultimate-member' ) ),
61
),
62
)
63
) )->render_form(); ?>
39
'size' => 'small'
40
),
41
array(
42
+ 'id' => '_um_directory_header',
43
+ 'type' => 'text',
44
+ 'label' => __( 'Results Text', 'ultimate-member' ),
45
+ 'tooltip' => __( 'Customize the search result text . e.g. Found 3,000 Members. Leave this blank to not show result text', 'ultimate-member' ),
46
+ 'description' => __( 'You could use {total_users} placeholder for getting users count', 'ultimate-member' ),
47
+ 'value' => UM()->query()->get_meta_value('_um_directory_header', null, 'na' ),
48
),
49
array(
50
+ 'id' => '_um_directory_header_single',
51
+ 'type' => 'text',
52
+ 'label' => __( 'Single Result Text', 'ultimate-member' ),
53
+ 'tooltip' => __( 'Same as above but in case of 1 user found only', 'ultimate-member' ),
54
+ 'description' => __( 'You could use {total_users} placeholder for getting users count', 'ultimate-member' ),
55
+ 'value' => UM()->query()->get_meta_value('_um_directory_header_single', null, 'na' ),
56
),
57
array(
58
+ 'id' => '_um_directory_no_users',
59
+ 'type' => 'text',
60
+ 'label' => __( 'Custom text if no users were found', 'ultimate-member' ),
61
+ 'tooltip' => __( 'This is the text that is displayed if no users are found during a search', 'ultimate-member' ),
62
+ 'value' => UM()->query()->get_meta_value('_um_directory_no_users', null, 'na' ),
63
),
64
)
65
) )->render_form(); ?>
includes/admin/templates/directory/profile.php CHANGED
@@ -48,6 +48,7 @@
48
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
49
'options' => $user_fields,
50
'show_default_number' => 1,
51
),
52
array(
53
'id' => '_um_show_userinfo',
@@ -58,24 +59,26 @@
58
array(
59
'id' => '_um_reveal_fields',
60
'type' => 'multi_selects',
61
- 'label' => __( 'Choose field(s) to display in reveal section', 'ultimate-member' ),
62
'value' => $_um_reveal_fields,
63
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
64
'conditional' => array( '_um_show_userinfo', '=', 1 ),
65
'options' => $user_fields,
66
'show_default_number' => 1,
67
),
68
array(
69
'id' => '_um_show_social',
70
'type' => 'checkbox',
71
- 'label' => __( 'Show social connect icons', 'ultimate-member' ),
72
'value' => UM()->query()->get_meta_value( '_um_show_social' ),
73
'conditional' => array( '_um_show_userinfo', '=', 1 )
74
),
75
array(
76
'id' => '_um_userinfo_animate',
77
'type' => 'checkbox',
78
- 'label' => __( 'Enable reveal section transition by default', 'ultimate-member' ),
79
'value' => UM()->query()->get_meta_value( '_um_userinfo_animate' ),
80
'conditional' => array( '_um_show_userinfo', '=', 1 )
81
),
48
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
49
'options' => $user_fields,
50
'show_default_number' => 1,
51
+ 'sorting' => true,
52
),
53
array(
54
'id' => '_um_show_userinfo',
59
array(
60
'id' => '_um_reveal_fields',
61
'type' => 'multi_selects',
62
+ 'label' => __( 'Choose field(s) to display in extra user information section', 'ultimate-member' ),
63
'value' => $_um_reveal_fields,
64
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
65
'conditional' => array( '_um_show_userinfo', '=', 1 ),
66
'options' => $user_fields,
67
'show_default_number' => 1,
68
+ 'sorting' => true,
69
),
70
array(
71
'id' => '_um_show_social',
72
'type' => 'checkbox',
73
+ 'label' => __( 'Show social connect icons in extra user information section', 'ultimate-member' ),
74
'value' => UM()->query()->get_meta_value( '_um_show_social' ),
75
'conditional' => array( '_um_show_userinfo', '=', 1 )
76
),
77
array(
78
'id' => '_um_userinfo_animate',
79
'type' => 'checkbox',
80
+ 'label' => __( 'Hide extra user information to the reveal section', 'ultimate-member' ),
81
+ 'tooltip' => __( 'If not checked always shown', 'ultimate-member' ),
82
'value' => UM()->query()->get_meta_value( '_um_userinfo_animate' ),
83
'conditional' => array( '_um_show_userinfo', '=', 1 )
84
),
includes/admin/templates/directory/search.php CHANGED
@@ -92,15 +92,24 @@ global $post_id; ?>
92
'options' => UM()->member_directory()->filter_fields,
93
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
94
'show_default_number' => 1,
95
),
96
array(
97
'id' => '_um_filters_expanded',
98
'type' => 'checkbox',
99
'label' => __( 'Expand the filter bar by default', 'ultimate-member' ),
100
- 'tooltip' => __( 'If turned on, filters bar will be visible after a page loading and can be collapsed', 'ultimate-member' ),
101
'value' => UM()->query()->get_meta_value( '_um_filters_expanded' ),
102
'conditional' => array( '_um_filters', '=', 1 )
103
),
104
array(
105
'id' => '_um_search_filters',
106
'type' => 'md_default_filters',
92
'options' => UM()->member_directory()->filter_fields,
93
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
94
'show_default_number' => 1,
95
+ 'sorting' => true,
96
),
97
array(
98
'id' => '_um_filters_expanded',
99
'type' => 'checkbox',
100
'label' => __( 'Expand the filter bar by default', 'ultimate-member' ),
101
+ 'tooltip' => __( 'If turned on, filters bar will be visible after a page loading', 'ultimate-member' ),
102
'value' => UM()->query()->get_meta_value( '_um_filters_expanded' ),
103
'conditional' => array( '_um_filters', '=', 1 )
104
),
105
+ array(
106
+ 'id' => '_um_filters_is_collapsible',
107
+ 'type' => 'checkbox',
108
+ 'label' => __( 'Can filter bar be collapsed', 'ultimate-member' ),
109
+ 'tooltip' => __( 'If turned on, filters bar can be collapsed after a page loading', 'ultimate-member' ),
110
+ 'value' => UM()->query()->get_meta_value( '_um_filters_is_collapsible' ),
111
+ 'conditional' => array( '_um_filters_expanded', '=', 1 )
112
+ ),
113
array(
114
'id' => '_um_search_filters',
115
'type' => 'md_default_filters',
includes/class-config.php CHANGED
@@ -169,6 +169,7 @@ if ( ! class_exists( 'um\Config' ) ) {
169
'_um_roles_can_filter' => array(),
170
'_um_search_fields' => array(),
171
'_um_filters_expanded' => 0,
172
'_um_search_filters' => array(),
173
174
'_um_must_search' => 0,
169
'_um_roles_can_filter' => array(),
170
'_um_search_fields' => array(),
171
'_um_filters_expanded' => 0,
172
+ '_um_filters_is_collapsible' => 1,
173
'_um_search_filters' => array(),
174
175
'_um_must_search' => 0,
includes/class-init.php CHANGED
@@ -519,8 +519,9 @@ if ( ! class_exists( 'UM' ) ) {
519
$this->columns();
520
$this->admin()->notices();
521
$this->admin_navmenu();
522
- $this->theme_updater();
523
$this->access();
524
} elseif ( $this->is_request( 'admin' ) ) {
525
$this->admin();
526
$this->admin_menu();
@@ -532,9 +533,9 @@ if ( ! class_exists( 'UM' ) ) {
532
$this->admin()->notices();
533
$this->users();
534
$this->dragdrop();
535
- $this->plugin_updater();
536
$this->admin_gdpr();
537
$this->admin_navmenu();
538
$this->theme_updater();
539
} elseif ( $this->is_request( 'frontend' ) ) {
540
$this->enqueue();
519
$this->columns();
520
$this->admin()->notices();
521
$this->admin_navmenu();
522
$this->access();
523
+ $this->plugin_updater();
524
+ $this->theme_updater();
525
} elseif ( $this->is_request( 'admin' ) ) {
526
$this->admin();
527
$this->admin_menu();
533
$this->admin()->notices();
534
$this->users();
535
$this->dragdrop();
536
$this->admin_gdpr();
537
$this->admin_navmenu();
538
+ $this->plugin_updater();
539
$this->theme_updater();
540
} elseif ( $this->is_request( 'frontend' ) ) {
541
$this->enqueue();
includes/core/class-account.php CHANGED
@@ -575,6 +575,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
575
function get_tab_fields( $id, $shortcode_args ) {
576
$output = null;
577
578
UM()->fields()->set_mode = 'account';
579
UM()->fields()->editing = true;
580
575
function get_tab_fields( $id, $shortcode_args ) {
576
$output = null;
577
578
+ UM()->fields()->set_id = $id;
579
UM()->fields()->set_mode = 'account';
580
UM()->fields()->editing = true;
581
includes/core/class-builtin.php CHANGED
@@ -1342,6 +1342,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
1342
$array['skype'] = __('Skype ID','ultimate-member');
1343
$array['soundcloud'] = __('SoundCloud Profile','ultimate-member');
1344
$array['twitter_url'] = __('Twitter URL','ultimate-member');
1345
$array['unique_email'] = __('Unique E-mail','ultimate-member');
1346
$array['unique_value'] = __('Unique Metakey value','ultimate-member');
1347
$array['unique_username'] = __('Unique Username','ultimate-member');
1342
$array['skype'] = __('Skype ID','ultimate-member');
1343
$array['soundcloud'] = __('SoundCloud Profile','ultimate-member');
1344
$array['twitter_url'] = __('Twitter URL','ultimate-member');
1345
+ $array['is_email'] = __('E-mail( Not Unique )','ultimate-member');
1346
$array['unique_email'] = __('Unique E-mail','ultimate-member');
1347
$array['unique_value'] = __('Unique Metakey value','ultimate-member');
1348
$array['unique_username'] = __('Unique Username','ultimate-member');
includes/core/class-enqueue.php CHANGED
@@ -141,7 +141,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
141
142
wp_register_script('um_dropdown', $this->js_baseurl . 'dropdown' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
143
144
- wp_register_script('um_members', $this->js_baseurl . 'um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks' ), ultimatemember_version, true );
145
wp_register_script('um_profile', $this->js_baseurl . 'um-profile' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'wp-i18n' ), ultimatemember_version, true );
146
wp_register_script('um_account', $this->js_baseurl . 'um-account' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
147
141
142
wp_register_script('um_dropdown', $this->js_baseurl . 'dropdown' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
143
144
+ wp_register_script('um_members', $this->js_baseurl . 'um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks', 'jquery-masonry' ), ultimatemember_version, true );
145
wp_register_script('um_profile', $this->js_baseurl . 'um-profile' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'wp-i18n' ), ultimatemember_version, true );
146
wp_register_script('um_account', $this->js_baseurl . 'um-account' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
147
includes/core/class-external-integrations.php CHANGED
@@ -269,6 +269,9 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
269
function get_languages_codes( $current_code = false ) {
270
global $sitepress;
271
272
$current_code = ! empty( $current_code ) ? $current_code : $sitepress->get_current_language();
273
274
$default = $sitepress->get_locale_from_language_code( $sitepress->get_default_language() );
269
function get_languages_codes( $current_code = false ) {
270
global $sitepress;
271
272
+ if ( ! $this->is_wpml_active() )
273
+ return $current_code;
274
+
275
$current_code = ! empty( $current_code ) ? $current_code : $sitepress->get_current_language();
276
277
$default = $sitepress->get_locale_from_language_code( $sitepress->get_default_language() );
includes/core/class-fields.php CHANGED
@@ -591,22 +591,26 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
591
* @return mixed
592
*/
593
function field_value( $key, $default = false, $data = null ) {
594
- if ( isset( $_SESSION ) && isset( $_SESSION['um_social_profile'][ $key ] ) && isset( $this->set_mode ) && $this->set_mode == 'register' ) {
595
- return $_SESSION['um_social_profile'][ $key ];
596
- }
597
-
598
- $type = ( isset( $data['type'] ) ) ? $data['type'] : '';
599
-
600
// preview in backend
601
if ( isset( UM()->user()->preview ) && UM()->user()->preview ) {
602
- $submitted = um_user( 'submitted' );
603
- if ( ! empty( $submitted[ $key ] ) ) {
604
- return $submitted[ $key ];
605
} else {
606
- return __( 'Undefined', 'ultimate-member' );
607
}
608
}
609
610
// normal state
611
if ( isset( UM()->form()->post_form[ $key ] ) ) {
612
//show empty value for password fields
@@ -1124,11 +1128,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1124
$arr_options = $opts['options'];
1125
1126
} elseif ( function_exists( $data['custom_dropdown_options_source'] ) ) {
1127
1128
- $arr_options = call_user_func(
1129
- $data['custom_dropdown_options_source'],
1130
- ( ! empty( $data['parent_dropdown_relationship'] ) ? $data['parent_dropdown_relationship'] : '' )
1131
- );
1132
}
1133
1134
if ( $has_custom_source || function_exists( $data['custom_dropdown_options_source'] ) ) {
@@ -1181,7 +1188,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1181
if ( in_array( $type, array( 'select', 'multiselect' ) ) && ! empty( $data['custom_dropdown_options_source'] ) ) {
1182
1183
if ( function_exists( $data['custom_dropdown_options_source'] ) ) {
1184
- $arr_options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] );
1185
}
1186
1187
}
@@ -1798,13 +1809,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1798
*/
1799
function edit_field( $key, $data, $rule = false, $args = array() ) {
1800
global $_um_profile_id;
1801
- $output = null;
1802
$disabled = '';
1803
if ( empty( $_um_profile_id ) ) {
1804
$_um_profile_id = um_user( 'ID' );
1805
}
1806
1807
-
1808
// get whole field data
1809
if ( isset( $data ) && is_array( $data ) ) {
1810
$data = $this->get_field( $key );
@@ -1826,7 +1837,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1826
* @var boolean $editable
1827
* @var string $icon
1828
* @var boolean $in_group
1829
- * @var string $classes
1830
* @var boolean $required
1831
* @var string $validate
1832
* @var string $default
@@ -1870,20 +1880,57 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1870
}
1871
1872
if ( ! isset( $data['type'] ) ) {
1873
- return;
1874
}
1875
1876
if ( isset( $data['in_group'] ) && $data['in_group'] != '' && $rule != 'group' ) {
1877
- return;
1878
}
1879
1880
if ( $visibility == 'view' && $this->set_mode != 'register' ) {
1881
- return;
1882
}
1883
1884
- if ( ( $visibility == 'view' && $this->set_mode == 'register' ) ||
1885
- ( isset( $data['editable'] ) && $data['editable'] == 0 && $this->set_mode == 'profile' )
1886
- ) {
1887
1888
um_fetch_user( get_current_user_id() );
1889
if ( ! um_user( 'can_edit_everyone' ) ) {
@@ -1905,48 +1952,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1905
$autocomplete = 'off';
1906
}
1907
1908
- um_fetch_user( get_current_user_id() );
1909
- if ( ! um_can_view_field( $data ) ) {
1910
- return;
1911
- }
1912
- if ( ! um_can_edit_field( $data ) ) {
1913
- return;
1914
- }
1915
- um_fetch_user( $_um_profile_id );
1916
-
1917
- // fields that need to be disabled in edit mode (profile)
1918
- $arr_restricted_fields = $this->get_restricted_fields_for_edit( $_um_profile_id );
1919
- if ( in_array( $key, $arr_restricted_fields ) && $this->editing == true && $this->set_mode == 'profile' ) {
1920
- return;
1921
- }
1922
-
1923
- // forbidden in edit mode?
1924
- if ( isset( $data['edit_forbidden'] ) ) {
1925
- return;
1926
}
1927
1928
-
1929
- // required option
1930
- if ( isset( $data['required_opt'] ) ) {
1931
- $opt = $data['required_opt'];
1932
- if ( UM()->options()->get( $opt[0] ) != $opt[1] ) {
1933
- return;
1934
- }
1935
- }
1936
-
1937
- // required user permission
1938
- if ( isset( $data['required_perm'] ) ) {
1939
- if ( ! um_user( $data['required_perm'] ) ) {
1940
- return;
1941
- }
1942
- }
1943
-
1944
- // do not show passwords
1945
- if ( isset( UM()->user()->preview ) && UM()->user()->preview ) {
1946
- if ( $data['type'] == 'password' ) {
1947
- return;
1948
- }
1949
- }
1950
1951
/**
1952
* UM hook
@@ -2047,7 +2057,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2047
case 'vimeo_video':
2048
case 'soundcloud_track':
2049
2050
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . $key . '">';
2051
2052
if ( isset( $data['label'] ) ) {
2053
$output .= $this->field_label( $label, $key, $data );
@@ -2066,7 +2076,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2066
2067
$output .= '<input ' . $disabled . ' class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2068
2069
- </div>';
2070
2071
if ( ! empty( $disabled ) ) {
2072
$output .= $this->disabled_hidden_field( $field_name, $field_value );
@@ -2082,7 +2092,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2082
/* Text */
2083
case 'text':
2084
2085
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2086
2087
if ( isset( $data['label'] ) ) {
2088
$output .= $this->field_label( $label, $key, $data );
@@ -2101,7 +2111,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2101
2102
$output .= '<input ' . $disabled . ' autocomplete="' . esc_attr( $autocomplete ) . '" class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2103
2104
- </div>';
2105
2106
if ( ! empty( $disabled ) ) {
2107
$output .= $this->disabled_hidden_field( $field_name, $field_value );
@@ -2117,7 +2127,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2117
/* Number */
2118
case 'number':
2119
2120
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2121
2122
if ( isset( $data['label'] ) ) {
2123
$output .= $this->field_label( $label, $key, $data );
@@ -2141,7 +2151,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2141
2142
$output .= '<input ' . $disabled . ' class="' . $this->get_class( $key, $data ) . '" type="number" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . esc_attr( htmlspecialchars( $this->field_value( $key, $default, $data ) ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $number_limit . ' />
2143
2144
- </div>';
2145
2146
if ( $this->is_error( $key ) ) {
2147
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2159,7 +2169,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2159
2160
$key = $original_key;
2161
2162
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2163
2164
if ( isset( $data['label'] ) ) {
2165
$output .= $this->field_label( $label, $key, $data );
@@ -2175,7 +2185,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2175
2176
$output .= '<input class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2177
2178
- </div>';
2179
2180
if ( $this->is_error( $key ) ) {
2181
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2188,7 +2198,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2188
if ( $this->set_mode == 'account' || um_is_core_page( 'account' ) ) {
2189
2190
$key = 'current_' . $original_key;
2191
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2192
2193
if ( isset( $data['label'] ) ) {
2194
$output .= $this->field_label( __( 'Current Password', 'ultimate-member' ), $key, $data );
@@ -2204,7 +2214,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2204
2205
$output .= '<input class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2206
2207
- </div>';
2208
2209
if ( $this->is_error( $key ) ) {
2210
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2216,7 +2226,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2216
2217
$key = $original_key;
2218
2219
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2220
2221
if ( $this->set_mode == 'account' && um_is_core_page( 'account' ) || $this->set_mode == 'password' && um_is_core_page( 'password-reset' ) ) {
2222
@@ -2238,7 +2248,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2238
2239
$output .= '<input class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2240
2241
- </div>';
2242
2243
if ( $this->is_error( $key ) ) {
2244
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2249,7 +2259,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2249
if ( $this->set_mode != 'login' && isset( $data['force_confirm_pass'] ) && $data['force_confirm_pass'] == 1 ) {
2250
2251
$key = 'confirm_' . $original_key;
2252
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2253
2254
if ( isset( $data['label'] ) ) {
2255
$output .= $this->field_label( sprintf( __( 'Confirm %s', 'ultimate-member' ), $data['label'] ), $key, $data );
@@ -2265,7 +2275,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2265
2266
$output .= '<input class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2267
2268
- </div>';
2269
2270
if ( $this->is_error( $key ) ) {
2271
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2282,7 +2292,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2282
/* URL */
2283
case 'url':
2284
2285
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2286
2287
if ( isset( $data['label'] ) ) {
2288
$output .= $this->field_label( $label, $key, $data );
@@ -2298,7 +2308,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2298
2299
$output .= '<input ' . $disabled . ' class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
2300
2301
- </div>';
2302
2303
if ( $this->is_error( $key ) ) {
2304
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2310,7 +2320,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2310
/* Date */
2311
case 'date':
2312
2313
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ). '">';
2314
2315
if (isset( $data['label'] )) {
2316
$output .= $this->field_label( $label, $key, $data );
@@ -2326,7 +2336,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2326
2327
$output .= '<input ' . $disabled . ' class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-range="' . esc_attr( $range ) . '" data-years="' . esc_attr( $years ) . '" data-years_x="' . esc_attr( $years_x ) . '" data-disabled_weekdays="' . esc_attr( $disabled_weekdays ) . '" data-date_min="' . esc_attr( $date_min ) . '" data-date_max="' . esc_attr( $date_max ) . '" data-format="' . esc_attr( $js_format ) . '" data-value="' . $this->field_value( $key, $default, $data ) . '" />
2328
2329
- </div>';
2330
2331
if ( $this->is_error( $key ) ) {
2332
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2338,7 +2348,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2338
/* Time */
2339
case 'time':
2340
2341
- $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . esc_attr( $key ) . '">';
2342
2343
if (isset( $data['label'] )) {
2344
$output .= $this->field_label( $label, $key, $data );
@@ -2354,7 +2364,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2354
2355
$output .= '<input ' . $disabled . ' class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $key . UM()->form()->form_suffix ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-format="' . esc_attr( $js_format ) . '" data-intervals="' . esc_attr( $intervals ) . '" data-value="' . $this->field_value( $key, $default, $data ) . '" />
2356
2357
- </div>';
2358
2359
if ( $this->is_error( $key ) ) {
2360
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2370,7 +2380,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2370
2371
/* Textarea */<