Ultimate Member – User Profile & Membership Plugin - Version 2.1.10

Version Description

Download this release

Release Info

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

Code changes from version 2.1.9 to 2.1.10

includes/admin/assets/js/um-admin-blocks-shortcode.js CHANGED
@@ -1,43 +1,29 @@
1
- (function (blocks, editor, components, i18n, element) {
2
- var um_el = wp.element.createElement,
3
- UmRegisterBlockType = wp.blocks.registerBlockType,
4
- UmRichText = wp.editor.RichText,
5
- UmTextControl = wp.components.TextControl,
6
- UmSelectControl = wp.components.SelectControl,
7
- UmToggleControl = wp.components.ToggleControl,
8
- UmPanelBody = wp.components.PanelBody,
9
- UmRangeControl = wp.components.RangeControl,
10
- UmSpinner = wp.components.Spinner,
11
- UmData = wp.data,
12
- UmWithSelect = wp.data.withSelect,
13
- UmApiFetch = wp.apiFetch;
14
-
15
- //-------------------------------------\\
16
- //--------- Um Forms shortcode --------\\
17
- //-------------------------------------\\
18
-
19
- UmRegisterBlockType('um-block/um-forms', {
20
- title: i18n.__( 'UM Form' , 'ultimate-member' ),
21
- description: i18n.__( 'Choose display form', 'ultimate-member' ),
22
- icon: 'forms',
23
- category: 'um-blocks',
24
- attributes: {
25
- content: {
26
- source: 'html',
27
- selector: 'p'
28
- },
29
- form_id: {
30
- type: 'select'
31
- }
32
  },
33
-
34
- edit: UmWithSelect(function (select) {
35
- return {
36
- posts: select('core').getEntityRecords( 'postType', 'um_form', {
37
- per_page: -1
38
- })
39
- };
40
- })(function ( props ) {
 
 
 
 
41
  var posts = props.posts,
42
  className = props.className,
43
  attributes = props.attributes,
@@ -74,99 +60,100 @@
74
 
75
 
76
  if ( ! posts ) {
77
- return um_el(
78
  'p',
79
  {
80
  className: className
81
  },
82
- um_el(
83
- UmSpinner,
84
  null
85
  ),
86
- i18n.__( 'Loading Forms', 'ultimate-member' )
87
  );
88
  }
89
 
90
  if ( 0 === posts.length ) {
91
- return um_el(
92
  'p',
93
  null,
94
- i18n.__( 'No Posts', 'ultimate-member' )
95
  );
96
  }
97
 
98
  if ( form_id === undefined ) {
99
  props.setAttributes({ form_id: posts[0]['id'] });
100
- var shortcode = umShortcode(posts[0]['id']);
101
  props.setAttributes( { content: shortcode } );
102
  }
103
 
104
  var get_post = get_option( posts );
105
 
106
- return um_el(
107
  'div',
108
  {
109
  className: className
110
  },
111
- um_el(
112
- UmSelectControl,
113
  {
114
- label: i18n.__( 'Select Forms', 'ultimate-member' ),
115
- className: "um_select_users",
116
  type: 'number',
117
  value: form_id,
118
  options: get_post,
119
  onChange: function onChange( value ) {
120
  props.setAttributes({ form_id: value });
121
- var shortcode = umShortcode(value);
122
  props.setAttributes( { content: shortcode } );
123
  }
124
  }
125
  )
126
  );
127
  } // end withSelect
128
- ), // end edit
129
-
130
- save: function save( props ) {
131
 
132
- return um_el(
133
- UmRichText.Content,
134
- {
135
- tagName: 'p',
136
- className: props.className,
137
- value: props.attributes.content
138
- }
139
- );
140
- }
141
 
142
- });
143
-
144
- //-------------------------------------\\
145
- //-- Um Member Directories shortcode --\\
146
- //-------------------------------------\\
147
-
148
- UmRegisterBlockType( 'um-block/um-member-directories', {
149
- title: i18n.__( 'UM Member Directories', 'ultimate-member'),
150
- description: i18n.__( 'Choose display form', 'ultimate-member' ),
151
- icon: 'groups',
152
- category: 'um-blocks',
153
- attributes: {
154
- content: {
155
- source: 'html',
156
- selector: 'p'
157
- },
158
- member_id: {
159
- type: 'select'
160
  }
161
- },
 
 
 
 
 
 
 
 
162
 
163
- edit: UmWithSelect( function( select ) {
164
- return {
165
- posts: select('core').getEntityRecords( 'postType', 'um_directory', {
166
- per_page: -1
167
- })
168
- };
169
- })(function ( props ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  var posts = props.posts,
171
  className = props.className,
172
  attributes = props.attributes,
@@ -201,24 +188,24 @@
201
  }
202
 
203
  if ( ! posts ) {
204
- return um_el(
205
  'p',
206
  {
207
  className: className
208
  },
209
- um_el(
210
- UmSpinner,
211
  null
212
  ),
213
- i18n.__( 'Loading Forms', 'ultimate-member' )
214
  );
215
  }
216
 
217
  if ( 0 === posts.length ) {
218
- return um_el(
219
  'p',
220
  null,
221
- i18n.__( 'No Posts', 'ultimate-member' )
222
  );
223
  }
224
 
@@ -230,16 +217,16 @@
230
 
231
  var get_post = get_option( posts );
232
 
233
- return um_el(
234
  'div',
235
  {
236
  className: className
237
  },
238
- um_el(
239
- UmSelectControl,
240
  {
241
- label: i18n.__( 'Select Directories', 'ultimate-member' ),
242
- className: "um_select_member",
243
  type: 'number',
244
  value: member_id,
245
  options: get_post,
@@ -252,359 +239,167 @@
252
  )
253
  );
254
  } // end withSelect
255
- ), // end edit
256
 
257
- save: function save( props ) {
258
-
259
- return um_el(
260
- UmRichText.Content,
261
- {
262
- tagName: 'p',
263
- className: props.className,
264
- value: props.attributes.content
265
- }
266
- );
267
- }
268
 
269
- });
270
-
271
- //-------------------------------------\\
272
- //--------- Um password reset ---------\\
273
- //-------------------------------------\\
274
- UmRegisterBlockType('um-block/um-password-reset', {
275
- title: i18n.__( 'UM Password Reset', 'ultimate-member' ),
276
- description: i18n.__( 'Password Reset', 'ultimate-member' ),
277
- icon: 'unlock',
278
- category: 'um-blocks',
279
- attributes: {
280
- content: {
281
- source: 'html',
282
- selector: 'p'
283
  }
284
- },
285
-
286
- edit: function( props ) {
287
- var content = props.attributes.content;
288
- props.setAttributes({ content: '[ultimatemember_password]' });
289
-
290
- return [
291
- um_el(
292
- "div",
293
- {
294
- className: "um-password-reset-wrapper"
295
- },
296
- i18n.__( 'Password Reset', 'ultimate-member' )
297
- )
298
- ]
299
- },
300
-
301
- save: function( props ) {
302
 
303
- return um_el(
304
- UmRichText.Content,
305
- {
306
- tagName: 'p',
307
- className: props.className,
308
- value: props.attributes.content
309
- }
310
- );
 
 
 
 
 
 
311
  }
312
- });
313
-
314
- //-------------------------------------\\
315
- //------------ Um Account -------------\\
316
- //-------------------------------------\\
317
- UmRegisterBlockType('um-block/um-account', {
318
- title: i18n.__( 'UM Account', 'ultimate-member' ),
319
- description: i18n.__( 'UM Account', 'ultimate-member' ),
320
- icon: 'id',
321
- category: 'um-blocks',
322
- attributes: {
323
- content: {
324
- source: 'html',
325
- selector: 'p'
326
- },
327
- tab: {
328
- type: 'select'
329
- }
330
- },
331
-
332
- edit: function( props ) {
333
- var content = props.attributes.content,
334
- tab = props.attributes.tab,
335
- options = um_account_settings;
336
-
337
- function get_options() {
338
- var option = [];
339
-
340
- option.push( { label: i18n.__( 'All', 'ultimate-member' ), value: 'all' } );
341
-
342
- for ( var key in options ) {
343
- if ( options.hasOwnProperty( key ) && options[ key ]['enabled'] ) {
344
- option.push(
345
- {
346
- label: options[ key ]['label'],
347
- value: key
348
- }
349
- )
350
- }
351
- }
352
 
353
- return option;
354
- }
355
-
356
- function umShortcode( value ) {
357
-
358
- var shortcode = '[ultimatemember_account';
359
-
360
- if ( value != 'all' ) {
361
- shortcode = shortcode + ' tab="' + value + '"';
362
- }
363
-
364
- shortcode = shortcode + ']';
365
 
366
- props.setAttributes({ content: shortcode });
367
- }
368
-
369
- if ( content === undefined ) {
370
- props.setAttributes({ content: '[ultimatemember_account]' });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  }
372
-
373
- return [
374
- um_el(
375
- "div",
376
- {
377
- className: "um-account-wrapper"
378
- },
379
- i18n.__( 'UM Account', 'ultimate-member' )
380
- ),
381
- um_el(
382
- wp.editor.InspectorControls,
383
- {},
384
- um_el(
385
- UmPanelBody,
386
- {
387
- title: i18n.__( 'Account Tab', 'ultimate-member' )
388
- },
389
- um_el(
390
- UmSelectControl,
391
- {
392
- label: i18n.__( 'Select Tab', 'ultimate-member' ),
393
- className: "um_select_account_tab",
394
- type: 'number',
395
- value: props.attributes.tab,
396
- options: get_options(),
397
- onChange: function onChange( value ) {
398
- props.setAttributes({ tab: value });
399
- umShortcode( value );
400
- }
401
- }
402
- )
403
- )
404
- )
405
- ]
406
  },
407
-
408
- save: function( props ) {
409
-
410
- return um_el(
411
- UmRichText.Content,
412
- {
413
- tagName: 'p',
414
- className: props.className,
415
- value: props.attributes.content
416
- }
417
- );
418
  }
419
- });
420
-
421
- //-------------------------------------\\
422
- //------ Social Activity function -----\\
423
- //-------------------------------------\\
424
- var um_users = getUsers();
425
 
426
- function getUsers() {
 
 
427
 
428
- var options = [],
429
- user_list = '';
430
 
431
- UmApiFetch( { path : '/wp/v2/users/' } ).then(
432
- function ( answer ) {
433
- user_list = answer;
434
 
435
- user_list.map(function (user) {
436
- options.push(
 
437
  {
438
- label: user.name,
439
- value: user.id
440
  }
441
- );
442
- });
443
-
444
  }
445
- );
446
 
447
- return options;
448
- }
449
 
450
- //-------------------------------------\\
451
- //----- Social Activity Shortcode -----\\
452
- //-------------------------------------\\
453
- UmRegisterBlockType( 'um-block/um-user-profile-wall', {
454
- title: i18n.__( 'User Profile Wall', 'ultimate-member' ),
455
- description: i18n.__( 'Used on the user profile page', 'ultimate-member' ),
456
- icon: 'businessman',
457
- category: 'um-blocks',
458
- attributes: { // Necessary for saving block content.
459
- content: {
460
- source: 'html',
461
- selector: 'p'
462
- },
463
- user_id: {
464
- type: 'select'
465
- },
466
- hashtag: {
467
- type: 'string'
468
- },
469
- wall_post: {
470
- type: 'number'
471
- },
472
- user_wall: {
473
- type: 'boolean'
474
- }
475
- },
476
 
477
- edit: function( props ) {
478
- var user_id = props.attributes.user_id,
479
- hashtag = props.attributes.hashtag,
480
- wall_post = props.attributes.wall_post,
481
- user_wall = props.attributes.user_wall,
482
- attributes = props.attributes,
483
- content = props.attributes.content;
484
 
485
- function onChangeContent( newContent ) {
486
- props.setAttributes( { content: newContent } );
487
  }
488
 
489
- function umShortcode() {
490
-
491
- var shortcode = '';
492
-
493
- if ( attributes.user_id !== undefined ) {
494
-
495
- shortcode = '[ultimatemember_wall user_id="' + attributes.user_id + '"';
496
-
497
- if( attributes.hashtag !== undefined ) {
498
- shortcode = shortcode + ' hashtag="' + attributes.hashtag + '"';
499
- }
500
-
501
- if( attributes.wall_post !== undefined ) {
502
- shortcode = shortcode + ' wall_post="' + attributes.wall_post + '"';
503
- }
504
-
505
- if( attributes.user_wall !== undefined ) {
506
- shortcode = shortcode + ' user_wall="' + attributes.user_wall + '"';
507
- }
508
-
509
- shortcode = shortcode + ']';
510
 
511
- props.setAttributes( { content: shortcode } );
 
512
 
513
- }
514
- }
 
515
 
516
- return [
517
- um_el(
518
- "div",
 
 
 
 
 
 
 
 
 
 
519
  {
520
- className: "um-social-activity-wrapper"
521
  },
522
- um_el(
523
- UmSelectControl,
524
  {
525
- label: i18n.__( 'Select User', 'ultimate-member' ),
526
- className: "um_select_users",
527
  type: 'number',
528
- value: props.attributes.user_id,
529
- options: um_users,
530
- onChange: function onChange( value ) {
531
- props.setAttributes({ user_id: value });
532
- attributes['user_id'] = value;
533
- umShortcode();
534
- }
535
- }
536
- ),
537
- um_el(
538
- UmTextControl,
539
- {
540
- className: "um_hashtag",
541
- label: i18n.__( 'Hashtag', 'ultimate-member' ),
542
- value: props.attributes.hashtag,
543
  onChange: function onChange( value ) {
544
- props.setAttributes({ hashtag: value });
545
- attributes['hashtag'] = value;
546
- umShortcode();
547
  }
548
  }
549
  )
550
-
551
- ),
552
- um_el(
553
- wp.editor.InspectorControls,
554
- {},
555
- um_el(
556
- UmPanelBody,
557
- {
558
- title: i18n.__( 'Shortcode Attribute', 'ultimate-member' )
559
- },
560
- um_el(
561
- UmRangeControl,
562
- {
563
- label: i18n.__( 'Show the form on the wall?', 'ultimate-member' ),
564
- value: props.attributes.wall_post,
565
- min: 2,
566
- max: 20,
567
- onChange: function onChange( value ) {
568
- props.setAttributes({ wall_post: value });
569
- attributes['wall_post'] = value;
570
- umShortcode();
571
- }
572
- }
573
- ),
574
- um_el(
575
- UmToggleControl,
576
- {
577
- label: i18n.__( 'Show the form on the wall?', 'ultimate-member' ),
578
- checked: props.attributes.user_wall,
579
- onChange: function onChange( value ) {
580
- props.setAttributes({ user_wall: value });
581
- attributes['user_wall'] = value;
582
- umShortcode();
583
- }
584
- }
585
- )
586
- )
587
  )
588
- ]
589
- },
590
-
591
- save: function( props ) {
592
-
593
- return um_el(
594
- UmRichText.Content,
595
- {
596
- tagName: 'p',
597
- className: props.className,
598
- value: props.attributes.content
599
- }
600
- );
601
- }
602
- });
603
-
604
- })(
605
- window.wp.blocks,
606
- window.wp.editor,
607
- window.wp.components,
608
- window.wp.i18n,
609
- window.wp.element
610
- );
1
+ //-------------------------------------\\
2
+ //--------- Um Forms shortcode --------\\
3
+ //-------------------------------------\\
4
+
5
+ wp.blocks.registerBlockType( 'um-block/um-forms', {
6
+ title: wp.i18n.__( 'Form', 'ultimate-member' ),
7
+ description: wp.i18n.__( 'Choose display form', 'ultimate-member' ),
8
+ icon: 'forms',
9
+ category: 'um-blocks',
10
+ attributes: {
11
+ content: {
12
+ source: 'html',
13
+ selector: 'p'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  },
15
+ form_id: {
16
+ type: 'select'
17
+ }
18
+ },
19
+
20
+ edit: wp.data.withSelect( function( select ) {
21
+ return {
22
+ posts: select( 'core' ).getEntityRecords( 'postType', 'um_form', {
23
+ per_page: -1
24
+ })
25
+ };
26
+ } )( function( props ) {
27
  var posts = props.posts,
28
  className = props.className,
29
  attributes = props.attributes,
60
 
61
 
62
  if ( ! posts ) {
63
+ return wp.element.createElement(
64
  'p',
65
  {
66
  className: className
67
  },
68
+ wp.element.createElement(
69
+ wp.components.Spinner,
70
  null
71
  ),
72
+ wp.i18n.__( 'Loading Forms', 'ultimate-member' )
73
  );
74
  }
75
 
76
  if ( 0 === posts.length ) {
77
+ return wp.element.createElement(
78
  'p',
79
  null,
80
+ wp.i18n.__( 'No Posts', 'ultimate-member' )
81
  );
82
  }
83
 
84
  if ( form_id === undefined ) {
85
  props.setAttributes({ form_id: posts[0]['id'] });
86
+ var shortcode = umShortcode( posts[0]['id'] );
87
  props.setAttributes( { content: shortcode } );
88
  }
89
 
90
  var get_post = get_option( posts );
91
 
92
+ return wp.element.createElement(
93
  'div',
94
  {
95
  className: className
96
  },
97
+ wp.element.createElement(
98
+ wp.components.SelectControl,
99
  {
100
+ label: wp.i18n.__( 'Select Forms', 'ultimate-member' ),
101
+ className: 'um_select_forms',
102
  type: 'number',
103
  value: form_id,
104
  options: get_post,
105
  onChange: function onChange( value ) {
106
  props.setAttributes({ form_id: value });
107
+ var shortcode = umShortcode( value );
108
  props.setAttributes( { content: shortcode } );
109
  }
110
  }
111
  )
112
  );
113
  } // end withSelect
114
+ ), // end edit
 
 
115
 
116
+ save: function save( props ) {
 
 
 
 
 
 
 
 
117
 
118
+ return wp.element.createElement(
119
+ wp.editor.RichText.Content,
120
+ {
121
+ tagName: 'p',
122
+ className: props.className,
123
+ value: props.attributes.content
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
125
+ );
126
+ }
127
+
128
+ });
129
+
130
+
131
+ //-------------------------------------\\
132
+ //-- Um Member Directories shortcode --\\
133
+ //-------------------------------------\\
134
 
135
+ wp.blocks.registerBlockType( 'um-block/um-member-directories', {
136
+ title: wp.i18n.__( 'Member Directory', 'ultimate-member' ),
137
+ description: wp.i18n.__( 'Choose display directory', 'ultimate-member' ),
138
+ icon: 'groups',
139
+ category: 'um-blocks',
140
+ attributes: {
141
+ content: {
142
+ source: 'html',
143
+ selector: 'p'
144
+ },
145
+ member_id: {
146
+ type: 'select'
147
+ }
148
+ },
149
+
150
+ edit: wp.data.withSelect( function( select ) {
151
+ return {
152
+ posts: select( 'core' ).getEntityRecords( 'postType', 'um_directory', {
153
+ per_page: -1
154
+ })
155
+ };
156
+ } )( function( props ) {
157
  var posts = props.posts,
158
  className = props.className,
159
  attributes = props.attributes,
188
  }
189
 
190
  if ( ! posts ) {
191
+ return wp.element.createElement(
192
  'p',
193
  {
194
  className: className
195
  },
196
+ wp.element.createElement(
197
+ wp.components.Spinner,
198
  null
199
  ),
200
+ wp.i18n.__( 'Loading Forms', 'ultimate-member' )
201
  );
202
  }
203
 
204
  if ( 0 === posts.length ) {
205
+ return wp.element.createElement(
206
  'p',
207
  null,
208
+ wp.i18n.__( 'No Posts', 'ultimate-member' )
209
  );
210
  }
211
 
217
 
218
  var get_post = get_option( posts );
219
 
220
+ return wp.element.createElement(
221
  'div',
222
  {
223
  className: className
224
  },
225
+ wp.element.createElement(
226
+ wp.components.SelectControl,
227
  {
228
+ label: wp.i18n.__( 'Select Directories', 'ultimate-member' ),
229
+ className: 'um_select_directory',
230
  type: 'number',
231
  value: member_id,
232
  options: get_post,
239
  )
240
  );
241
  } // end withSelect
242
+ ), // end edit
243
 
244
+ save: function save( props ) {
 
 
 
 
 
 
 
 
 
 
245
 
246
+ return wp.element.createElement(
247
+ wp.editor.RichText.Content,
248
+ {
249
+ tagName: 'p',
250
+ className: props.className,
251
+ value: props.attributes.content
 
 
 
 
 
 
 
 
252
  }
253
+ );
254
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
+ });
257
+
258
+ //-------------------------------------\\
259
+ //--------- Um password reset ---------\\
260
+ //-------------------------------------\\
261
+ wp.blocks.registerBlockType( 'um-block/um-password-reset', {
262
+ title: wp.i18n.__( 'Password Reset', 'ultimate-member' ),
263
+ description: wp.i18n.__( 'Displaying the password reset form', 'ultimate-member' ),
264
+ icon: 'unlock',
265
+ category: 'um-blocks',
266
+ attributes: {
267
+ content: {
268
+ source: 'html',
269
+ selector: 'p'
270
  }
271
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
+ edit: function( props ) {
274
+ var content = props.attributes.content;
275
+ props.setAttributes({ content: '[ultimatemember_password]' });
 
 
 
 
 
 
 
 
 
276
 
277
+ return [
278
+ wp.element.createElement(
279
+ "div",
280
+ {
281
+ className: "um-password-reset-wrapper"
282
+ },
283
+ wp.i18n.__( 'Password Reset', 'ultimate-member' )
284
+ )
285
+ ]
286
+ },
287
+
288
+ save: function( props ) {
289
+
290
+ return wp.element.createElement(
291
+ wp.editor.RichText.Content,
292
+ {
293
+ tagName: 'p',
294
+ className: props.className,
295
+ value: props.attributes.content
296
  }
297
+ );
298
+ }
299
+ });
300
+
301
+ //-------------------------------------\\
302
+ //------------ Um Account -------------\\
303
+ //-------------------------------------\\
304
+ wp.blocks.registerBlockType( 'um-block/um-account', {
305
+ title: wp.i18n.__( 'Account', 'ultimate-member' ),
306
+ description: wp.i18n.__( 'Displaying the account page of the current user', 'ultimate-member' ),
307
+ icon: 'id',
308
+ category: 'um-blocks',
309
+ attributes: {
310
+ content: {
311
+ source: 'html',
312
+ selector: 'p'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  },
314
+ tab: {
315
+ type: 'select'
 
 
 
 
 
 
 
 
 
316
  }
317
+ },
 
 
 
 
 
318
 
319
+ edit: function( props ) {
320
+ var content = props.attributes.content,
321
+ tab = props.attributes.tab;
322
 
323
+ function get_options() {
324
+ var option = [];
325
 
326
+ option.push( { label: wp.i18n.__( 'All', 'ultimate-member' ), value: 'all' } );
 
 
327
 
328
+ for ( var key in um_account_settings ) {
329
+ if ( um_account_settings.hasOwnProperty( key ) && um_account_settings[ key ]['enabled'] ) {
330
+ option.push(
331
  {
332
+ label: um_account_settings[ key ]['label'],
333
+ value: key
334
  }
335
+ )
336
+ }
 
337
  }
 
338
 
339
+ return option;
340
+ }
341
 
342
+ function umShortcode( value ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
+ var shortcode = '[ultimatemember_account';
 
 
 
 
 
 
345
 
346
+ if ( value !== 'all' ) {
347
+ shortcode = shortcode + ' tab="' + value + '"';
348
  }
349
 
350
+ shortcode = shortcode + ']';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
 
352
+ props.setAttributes({ content: shortcode });
353
+ }
354
 
355
+ if ( content === undefined ) {
356
+ props.setAttributes({ content: '[ultimatemember_account]' });
357
+ }
358
 
359
+ return [
360
+ wp.element.createElement(
361
+ "div",
362
+ {
363
+ className: 'um-account-wrapper'
364
+ },
365
+ wp.i18n.__( 'Account', 'ultimate-member' )
366
+ ),
367
+ wp.element.createElement(
368
+ wp.editor.InspectorControls,
369
+ {},
370
+ wp.element.createElement(
371
+ wp.components.PanelBody,
372
  {
373
+ title: wp.i18n.__( 'Account Tab', 'ultimate-member' )
374
  },
375
+ wp.element.createElement(
376
+ wp.components.SelectControl,
377
  {
378
+ label: wp.i18n.__( 'Select Tab', 'ultimate-member' ),
379
+ className: "um_select_account_tab",
380
  type: 'number',
381
+ value: props.attributes.tab,
382
+ options: get_options(),
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  onChange: function onChange( value ) {
384
+ props.setAttributes({ tab: value });
385
+ umShortcode( value );
 
386
  }
387
  }
388
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  )
390
+ )
391
+ ]
392
+ },
393
+
394
+ save: function( props ) {
395
+
396
+ return wp.element.createElement(
397
+ wp.editor.RichText.Content,
398
+ {
399
+ tagName: 'p',
400
+ className: props.className,
401
+ value: props.attributes.content
402
+ }
403
+ );
404
+ }
405
+ });
 
 
 
 
 
 
 
includes/admin/core/class-admin-enqueue.php CHANGED
@@ -130,7 +130,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
130
  wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
131
  wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
132
  wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
133
- wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
134
  // load a localized version for date/time
135
  $locale = get_locale();
136
  if ( $locale ) {
@@ -141,7 +141,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
141
  }
142
  }
143
 
144
- wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', 'select2', 'um_jquery_form', 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time', 'um_datetime_legacy' ), ultimatemember_version, true );
145
  wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $this->suffix . '.js', array( 'um_scripts' ), ultimatemember_version, true );
146
  wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $this->suffix . '.js', array( 'um_responsive' ), ultimatemember_version, true );
147
 
@@ -382,7 +382,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
382
  wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
383
  wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
384
  wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
385
- wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
386
  // load a localized version for date/time
387
  $locale = get_locale();
388
  if ( $locale ) {
@@ -399,7 +399,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
399
 
400
  wp_enqueue_style( 'um_datetime_date', 'um_datetime_time' );
401
 
402
- wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', array('jquery','wp-util', 'wp-color-picker', 'um_datetime', 'um_datetime_date', 'um_datetime_time', 'um_datetime_legacy' ), ultimatemember_version, true );
403
  wp_enqueue_script( 'um_admin_scripts' );
404
  }
405
 
@@ -453,6 +453,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
453
  wp_localize_script( 'um_block_js', 'um_restrict_roles', $restrict_options );
454
 
455
  wp_enqueue_script( 'um_block_js' );
 
 
456
  }
457
 
458
 
130
  wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
131
  wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
132
  wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
133
+ //wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
134
  // load a localized version for date/time
135
  $locale = get_locale();
136
  if ( $locale ) {
141
  }
142
  }
143
 
144
+ wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', 'select2', 'um_jquery_form', 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), ultimatemember_version, true );
145
  wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $this->suffix . '.js', array( 'um_scripts' ), ultimatemember_version, true );
146
  wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $this->suffix . '.js', array( 'um_responsive' ), ultimatemember_version, true );
147
 
382
  wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
383
  wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
384
  wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
385
+ //wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
386
  // load a localized version for date/time
387
  $locale = get_locale();
388
  if ( $locale ) {
399
 
400
  wp_enqueue_style( 'um_datetime_date', 'um_datetime_time' );
401
 
402
+ wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', array('jquery','wp-util', 'wp-color-picker', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), ultimatemember_version, true );
403
  wp_enqueue_script( 'um_admin_scripts' );
404
  }
405
 
453
  wp_localize_script( 'um_block_js', 'um_restrict_roles', $restrict_options );
454
 
455
  wp_enqueue_script( 'um_block_js' );
456
+
457
+ do_action( 'um_load_gutenberg_js' );
458
  }
459
 
460
 
includes/admin/core/class-admin-menu.php CHANGED
@@ -218,8 +218,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
218
  /** custom metaboxes for dashboard defined here **/
219
  add_meta_box( 'um-metaboxes-contentbox-1', __( 'Users Overview', 'ultimate-member' ), array( &$this, 'users_overview' ), $this->pagehook, 'core', 'core' );
220
 
221
- add_meta_box( 'um-metaboxes-mainbox-1', __( 'Latest from our blog', 'ultimate-member' ), array( &$this, 'um_news' ), $this->pagehook, 'normal', 'core' );
222
-
223
  add_meta_box( 'um-metaboxes-sidebox-1', __( 'Purge Temp Files', 'ultimate-member' ), array( &$this, 'purge_temp' ), $this->pagehook, 'side', 'core' );
224
 
225
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'User Cache', 'ultimate-member' ), array( &$this, 'user_cache' ), $this->pagehook, 'side', 'core' );
@@ -232,14 +230,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
232
  }
233
 
234
 
235
- /**
236
- *
237
- */
238
- function um_news() {
239
- include_once UM()->admin()->templates_path . 'dashboard/feed.php';
240
- }
241
-
242
-
243
  /**
244
  *
245
  */
218
  /** custom metaboxes for dashboard defined here **/
219
  add_meta_box( 'um-metaboxes-contentbox-1', __( 'Users Overview', 'ultimate-member' ), array( &$this, 'users_overview' ), $this->pagehook, 'core', 'core' );
220
 
 
 
221
  add_meta_box( 'um-metaboxes-sidebox-1', __( 'Purge Temp Files', 'ultimate-member' ), array( &$this, 'purge_temp' ), $this->pagehook, 'side', 'core' );
222
 
223
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'User Cache', 'ultimate-member' ), array( &$this, 'user_cache' ), $this->pagehook, 'side', 'core' );
230
  }
231
 
232
 
 
 
 
 
 
 
 
 
233
  /**
234
  *
235
  */
includes/admin/templates/dashboard/feed.php DELETED
@@ -1,23 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
-
3
-
4
- <div class="rss-widget">
5
- <?php wp_widget_rss_output(array(
6
- 'url' => 'https://ultimatemember.com/blog/feed/',
7
- 'title' => __( 'Latest From Ultimate Member', 'ultimate-member' ),
8
- 'items' => 4,
9
- 'show_summary' => 0,
10
- 'show_author' => 0,
11
- 'show_date' => 1,
12
- )); ?>
13
- </div>
14
-
15
- <style type='text/css'>
16
- #um-metaboxes-mainbox-1 a.rsswidget {
17
- font-weight: 400
18
- }
19
- #um-metaboxes-mainbox-1 .rss-widget span.rss-date{
20
- color: #777;
21
- margin-left: 12px;
22
- }
23
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/core/class-enqueue.php CHANGED
@@ -106,7 +106,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
106
  wp_register_script( 'um_datetime', $this->js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
107
  wp_register_script( 'um_datetime_date', $this->js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
108
  wp_register_script( 'um_datetime_time', $this->js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
109
- wp_register_script( 'um_datetime_legacy', $this->js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
110
  // load a localized version for date/time
111
  $locale = get_locale();
112
  if ( $locale ) {
@@ -128,7 +128,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
128
 
129
  wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false );
130
  wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), ultimatemember_version, true );
131
- wp_register_script('um_scripts', $this->js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_conditional', 'um_datetime', 'um_datetime_date', 'um_datetime_time', 'um_datetime_legacy', 'select2' ), ultimatemember_version, true );
132
  /**
133
  * UM hook
134
  *
@@ -364,7 +364,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
364
  wp_enqueue_script( 'um_datetime' );
365
  wp_enqueue_script( 'um_datetime_date' );
366
  wp_enqueue_script( 'um_datetime_time' );
367
- wp_enqueue_script( 'um_datetime_legacy' );
368
 
369
  // load a localized version for date/time
370
  $locale = get_locale();
106
  wp_register_script( 'um_datetime', $this->js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
107
  wp_register_script( 'um_datetime_date', $this->js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
108
  wp_register_script( 'um_datetime_time', $this->js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
109
+ // wp_register_script( 'um_datetime_legacy', $this->js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
110
  // load a localized version for date/time
111
  $locale = get_locale();
112
  if ( $locale ) {
128
 
129
  wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false );
130
  wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), ultimatemember_version, true );
131
+ wp_register_script('um_scripts', $this->js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_conditional', 'um_datetime', 'um_datetime_date', 'um_datetime_time', /*'um_datetime_legacy',*/ 'select2' ), ultimatemember_version, true );
132
  /**
133
  * UM hook
134
  *
364
  wp_enqueue_script( 'um_datetime' );
365
  wp_enqueue_script( 'um_datetime_date' );
366
  wp_enqueue_script( 'um_datetime_time' );
367
+ //wp_enqueue_script( 'um_datetime_legacy' );
368
 
369
  // load a localized version for date/time
370
  $locale = get_locale();
includes/core/class-fields.php CHANGED
@@ -3683,13 +3683,18 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
3683
  $roles = UM()->roles()->get_roles( false, $exclude_roles );
3684
 
3685
  if ( ! empty( $options ) ) {
 
 
 
 
 
3686
  //fix when customers change options for role (radio/dropdown) fields
3687
  $intersected_options = array();
3688
- foreach ( $options as $option ) {
3689
- if ( false !== $search_key = array_search( $option, $roles ) ) {
3690
- $intersected_options[ $search_key ] = $option;
3691
- } else {
3692
- $intersected_options[] = $option;
3693
  }
3694
  }
3695
 
3683
  $roles = UM()->roles()->get_roles( false, $exclude_roles );
3684
 
3685
  if ( ! empty( $options ) ) {
3686
+
3687
+ $roles = array_map( function( $item ) {
3688
+ return html_entity_decode( $item, ENT_QUOTES );
3689
+ }, $roles );
3690
+
3691
  //fix when customers change options for role (radio/dropdown) fields
3692
  $intersected_options = array();
3693
+ foreach ( $options as $key => $title ) {
3694
+ if ( false !== $search_key = array_search( $title, $roles ) ) {
3695
+ $intersected_options[ $search_key ] = $title;
3696
+ } elseif ( isset( $roles[ $key ] ) ) {
3697
+ $intersected_options[ $key ] = $title;
3698
  }
3699
  }
3700
 
includes/core/class-form.php CHANGED
@@ -587,18 +587,36 @@ if ( ! class_exists( 'um\core\Form' ) ) {
587
  function custom_field_roles( $custom_fields ) {
588
 
589
  $fields = maybe_unserialize( $custom_fields );
590
-
591
  if ( ! is_array( $fields ) ) {
592
  return false;
593
  }
594
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  foreach ( $fields as $field_key => $field_settings ) {
596
 
597
- if ( strstr( $field_key , 'role_' ) ) {
598
- if ( is_array( $field_settings['options'] ) ) {
599
- $option_pairs = apply_filters( 'um_select_options_pair', null, $field_settings );
600
- return ! empty( $option_pairs ) ? array_keys( $field_settings['options'] ) : array_values( $field_settings['options'] );
 
 
 
 
601
  }
 
 
 
602
  }
603
 
604
  }
587
  function custom_field_roles( $custom_fields ) {
588
 
589
  $fields = maybe_unserialize( $custom_fields );
 
590
  if ( ! is_array( $fields ) ) {
591
  return false;
592
  }
593
 
594
+ // role field
595
+ global $wp_roles;
596
+ $role_keys = array_map( function( $item ) {
597
+ return 'um_' . $item;
598
+ }, get_option( 'um_roles', array() ) );
599
+ $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
600
+
601
+ $roles = UM()->roles()->get_roles( false, $exclude_roles );
602
+ $roles = array_map( function( $item ) {
603
+ return html_entity_decode( $item, ENT_QUOTES );
604
+ }, $roles );
605
+
606
  foreach ( $fields as $field_key => $field_settings ) {
607
 
608
+ if ( strstr( $field_key, 'role_' ) && is_array( $field_settings['options'] ) ) {
609
+ $intersected_options = array();
610
+ foreach ( $field_settings['options'] as $key => $title ) {
611
+ if ( false !== $search_key = array_search( $title, $roles ) ) {
612
+ $intersected_options[ $search_key ] = $title;
613
+ } elseif ( isset( $roles[ $key ] ) ) {
614
+ $intersected_options[ $key ] = $title;
615
+ }
616
  }
617
+
618
+ // getting roles only from the first role fields
619
+ return array_keys( $intersected_options );
620
  }
621
 
622
  }
includes/core/class-mail.php CHANGED
@@ -405,7 +405,7 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
405
  return;
406
  }
407
 
408
- $this->attachments = null;
409
  $this->headers = 'From: '. stripslashes( UM()->options()->get('mail_from') ) .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n";
410
 
411
  /**
405
  return;
406
  }
407
 
408
+ $this->attachments = array();
409
  $this->headers = 'From: '. stripslashes( UM()->options()->get('mail_from') ) .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n";
410
 
411
  /**
includes/core/class-member-directory.php CHANGED
@@ -1734,7 +1734,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
1734
  case 'birth_date':
1735
 
1736
  $from_date = date( 'Y/m/d', mktime( 0,0,0, date( 'm', time() ), date( 'd', time() ), date( 'Y', time() - min( $value ) * YEAR_IN_SECONDS ) ) );
1737
- $to_date = date( 'Y/m/d', mktime( 0,0,0, date( 'm', time() ), date( 'd', time() ) + 1, date( 'Y', time() - ( max( $value ) + 1 ) * YEAR_IN_SECONDS ) - 1 ) );
1738
 
1739
  $meta_query = array(
1740
  array(
1734
  case 'birth_date':
1735
 
1736
  $from_date = date( 'Y/m/d', mktime( 0,0,0, date( 'm', time() ), date( 'd', time() ), date( 'Y', time() - min( $value ) * YEAR_IN_SECONDS ) ) );
1737
+ $to_date = date( 'Y/m/d', mktime( 0,0,0, date( 'm', time() ), date( 'd', time() ) + 1, date( 'Y', time() - ( max( $value ) + 1 ) * YEAR_IN_SECONDS ) ) );
1738
 
1739
  $meta_query = array(
1740
  array(
includes/core/class-shortcodes.php CHANGED
@@ -697,7 +697,11 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
697
  // show the first Profile Form with role selected, don't show profile forms below the page with other role-specific setting
698
  if ( empty( $this->profile_role ) ) {
699
  $current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
700
- if ( is_array( $args['role'] ) ) {
 
 
 
 
701
  if ( ! count( array_intersect( $args['role'], $current_user_roles ) ) ) {
702
  ob_get_clean();
703
  return '';
@@ -916,9 +920,9 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
916
  *
917
  * @return mixed|string
918
  */
919
- function get_template_name($file) {
920
- $file = basename($file);
921
- $file = preg_replace('/\\.[^.\\s]{3,4}$/', '', $file);
922
  return $file;
923
  }
924
 
@@ -930,32 +934,32 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
930
  *
931
  * @return mixed
932
  */
933
- function get_templates($excluded = null) {
934
 
935
- if ($excluded) {
936
- $array[$excluded] = __('Default Template', 'ultimate-member');
937
  }
938
 
939
- $paths[] = glob(um_path . 'templates/' . '*.php');
940
 
941
- if (file_exists(get_stylesheet_directory() . '/ultimate-member/templates/')) {
942
- $paths[] = glob(get_stylesheet_directory() . '/ultimate-member/templates/' . '*.php');
943
  }
944
 
945
- if( isset( $paths ) && ! empty( $paths ) ){
946
 
947
- foreach ($paths as $k => $files) {
948
 
949
- if( isset( $files ) && ! empty( $files ) ){
950
 
951
- foreach ($files as $file) {
952
 
953
  $clean_filename = $this->get_template_name( $file );
954
 
955
  if ( 0 === strpos( $clean_filename, $excluded ) ) {
956
 
957
  $source = file_get_contents( $file );
958
- $tokens = token_get_all( $source );
959
  $comment = array(
960
  T_COMMENT, // All comments since PHP5
961
  T_DOC_COMMENT, // PHPDoc comments
@@ -963,8 +967,8 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
963
  foreach ( $tokens as $token ) {
964
  if ( in_array( $token[0], $comment ) && strstr( $token[1], '/* Template:' ) && $clean_filename != $excluded ) {
965
  $txt = $token[1];
966
- $txt = str_replace('/* Template: ', '', $txt );
967
- $txt = str_replace(' */', '', $txt );
968
  $array[ $clean_filename ] = $txt;
969
  }
970
  }
@@ -980,7 +984,6 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
980
  }
981
 
982
  return $array;
983
-
984
  }
985
 
986
 
697
  // show the first Profile Form with role selected, don't show profile forms below the page with other role-specific setting
698
  if ( empty( $this->profile_role ) ) {
699
  $current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
700
+
701
+ if ( empty( $current_user_roles ) ) {
702
+ ob_get_clean();
703
+ return '';
704
+ } elseif ( is_array( $args['role'] ) ) {
705
  if ( ! count( array_intersect( $args['role'], $current_user_roles ) ) ) {
706
  ob_get_clean();
707
  return '';
920
  *
921
  * @return mixed|string
922
  */
923
+ function get_template_name( $file ) {
924
+ $file = basename( $file );
925
+ $file = preg_replace( '/\\.[^.\\s]{3,4}$/', '', $file );
926
  return $file;
927
  }
928
 
934
  *
935
  * @return mixed
936
  */
937
+ function get_templates( $excluded = null ) {
938
 
939
+ if ( $excluded ) {
940
+ $array[ $excluded ] = __( 'Default Template', 'ultimate-member' );
941
  }
942
 
943
+ $paths[] = glob( um_path . 'templates/' . '*.php' );
944
 
945
+ if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' ) ) {
946
+ $paths[] = glob( get_stylesheet_directory() . '/ultimate-member/templates/' . '*.php' );
947
  }
948
 
949
+ if ( isset( $paths ) && ! empty( $paths ) ) {
950
 
951
+ foreach ( $paths as $k => $files ) {
952
 
953
+ if ( isset( $files ) && ! empty( $files ) ) {
954
 
955
+ foreach ( $files as $file ) {
956
 
957
  $clean_filename = $this->get_template_name( $file );
958
 
959
  if ( 0 === strpos( $clean_filename, $excluded ) ) {
960
 
961
  $source = file_get_contents( $file );
962
+ $tokens = @\token_get_all( $source );
963
  $comment = array(
964
  T_COMMENT, // All comments since PHP5
965
  T_DOC_COMMENT, // PHPDoc comments
967
  foreach ( $tokens as $token ) {
968
  if ( in_array( $token[0], $comment ) && strstr( $token[1], '/* Template:' ) && $clean_filename != $excluded ) {
969
  $txt = $token[1];
970
+ $txt = str_replace( '/* Template: ', '', $txt );
971
+ $txt = str_replace( ' */', '', $txt );
972
  $array[ $clean_filename ] = $txt;
973
  }
974
  }
984
  }
985
 
986
  return $array;
 
987
  }
988
 
989
 
includes/core/um-actions-profile.php CHANGED
@@ -624,7 +624,7 @@ add_action( 'get_header', 'um_profile_remove_wpseo', 8 );
624
 
625
  /**
626
  * The profile page SEO tags
627
- *
628
  * @see https://ogp.me/ - The Open Graph protocol
629
  * @see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary - The Twitter Summary card
630
  * @see https://schema.org/Person - The schema.org Person schema
@@ -678,7 +678,7 @@ function um_profile_dynamic_meta_desc() {
678
  <!-- START - Ultimate Member profile SEO meta tags -->
679
 
680
  <link rel="image_src" href="<?php echo esc_url( $image ); ?>"/>
681
-
682
  <meta name="description" content="<?php echo esc_attr( $description ); ?>"/>
683
 
684
  <meta property="og:type" content="profile"/>
@@ -715,7 +715,7 @@ add_action( 'wp_head', 'um_profile_dynamic_meta_desc', 20 );
715
  * @param $args
716
  */
717
  function um_profile_header_cover_area( $args ) {
718
- if ( $args['cover_enabled'] == 1 ) {
719
 
720
  $default_cover = UM()->options()->get( 'default_cover' );
721
 
624
 
625
  /**
626
  * The profile page SEO tags
627
+ *
628
  * @see https://ogp.me/ - The Open Graph protocol
629
  * @see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary - The Twitter Summary card
630
  * @see https://schema.org/Person - The schema.org Person schema
678
  <!-- START - Ultimate Member profile SEO meta tags -->
679
 
680
  <link rel="image_src" href="<?php echo esc_url( $image ); ?>"/>
681
+
682
  <meta name="description" content="<?php echo esc_attr( $description ); ?>"/>
683
 
684
  <meta property="og:type" content="profile"/>
715
  * @param $args
716
  */
717
  function um_profile_header_cover_area( $args ) {
718
+ if ( isset( $args['cover_enabled'] ) && $args['cover_enabled'] == 1 ) {
719
 
720
  $default_cover = UM()->options()->get( 'default_cover' );
721
 
readme.txt CHANGED
@@ -6,8 +6,8 @@ Donate link:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires PHP: 5.6
8
  Requires at least: 5.0
9
- Tested up to: 5.5
10
- Stable tag: 2.1.9
11
  License: GNU Version 2 or Any Later Version
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
13
 
@@ -156,6 +156,20 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
156
  * To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
157
  * UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  = 2.1.9: September 9, 2020 =
160
 
161
  * Bugfixes:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires PHP: 5.6
8
  Requires at least: 5.0
9
+ Tested up to: 5.5.1
10
+ Stable tag: 2.1.10
11
  License: GNU Version 2 or Any Later Version
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
13
 
156
  * To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
157
  * UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
158
 
159
+ = 2.1.10: September 23, 2020 =
160
+
161
+ * Enhancements:
162
+
163
+ - Deprecated the Feed widget from Ultimate Member dashboard
164
+
165
+ * Bugfixes:
166
+
167
+ - Fixed age filter at Member Directory when using WP native usermeta table
168
+ - Fixed the role field values at the user profile/registration forms
169
+ - Fixed PHP notice when cover photo is empty
170
+ - Fixed the conflict issue with Pickadate JS library and their legacy.js functions
171
+ - Fixed Gutenberg Blocks descriptions
172
+
173
  = 2.1.9: September 9, 2020 =
174
 
175
  * Bugfixes:
ultimate-member.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
- Version: 2.1.9
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
+ Version: 2.1.10
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member