Ultimate Member – User Profile & Membership Plugin - Version 2.0.53

Version Description

Download this release

Release Info

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

Code changes from version 2.0.52 to 2.0.53

Files changed (46) hide show
  1. assets/img/extensions/bbpress.png +0 -0
  2. assets/img/extensions/followers.png +0 -0
  3. assets/img/extensions/forumwp.png +0 -0
  4. assets/img/extensions/friends.png +0 -0
  5. assets/img/extensions/google-recaptcha.png +0 -0
  6. assets/img/extensions/groups.png +0 -0
  7. assets/img/extensions/instagram.png +0 -0
  8. assets/img/extensions/mailchimp.png +0 -0
  9. assets/img/extensions/mycred.png +0 -0
  10. assets/img/extensions/notices.png +0 -0
  11. assets/img/extensions/online-users.png +0 -0
  12. assets/img/extensions/private-content.png +0 -0
  13. assets/img/extensions/private-messages.png +0 -0
  14. assets/img/extensions/profile-completeness.png +0 -0
  15. assets/img/extensions/real-time-notifications.png +0 -0
  16. assets/img/extensions/social-activity.png +0 -0
  17. assets/img/extensions/social-login.png +0 -0
  18. assets/img/extensions/terms-conditions.png +0 -0
  19. assets/img/extensions/user-bookmarks.png +0 -0
  20. assets/img/extensions/user-photos.png +0 -0
  21. assets/img/extensions/user-reviews.png +0 -0
  22. assets/img/extensions/user-tags.png +0 -0
  23. assets/img/extensions/verified-users.png +0 -0
  24. assets/img/extensions/woocommerce.png +0 -0
  25. assets/js/um-scripts.js +0 -5
  26. includes/admin/core/class-admin-settings.php +71 -34
  27. includes/admin/templates/access/restrict_content.php +86 -68
  28. includes/admin/templates/extensions.php +10 -27
  29. includes/admin/templates/form/profile_customize.php +43 -31
  30. includes/class-config.php +12 -7
  31. includes/class-dependencies.php +15 -1
  32. includes/class-init.php +1 -0
  33. includes/core/class-access.php +1 -1
  34. includes/core/class-enqueue.php +1 -1
  35. includes/core/class-fields.php +17 -9
  36. includes/core/class-mail.php +1 -1
  37. includes/core/class-profile.php +57 -78
  38. includes/core/class-shortcodes.php +0 -2
  39. includes/core/class-validation.php +5 -1
  40. includes/core/um-actions-account.php +14 -7
  41. includes/core/um-actions-profile.php +159 -121
  42. includes/core/um-filters-fields.php +26 -25
  43. languages/ultimate-member-en_US.mo +0 -0
  44. languages/ultimate-member-en_US.po +467 -434
  45. readme.txt +14 -1
  46. ultimate-member.php +1 -1
assets/img/extensions/bbpress.png ADDED
Binary file
assets/img/extensions/followers.png ADDED
Binary file
assets/img/extensions/forumwp.png ADDED
Binary file
assets/img/extensions/friends.png ADDED
Binary file
assets/img/extensions/google-recaptcha.png ADDED
Binary file
assets/img/extensions/groups.png ADDED
Binary file
assets/img/extensions/instagram.png ADDED
Binary file
assets/img/extensions/mailchimp.png ADDED
Binary file
assets/img/extensions/mycred.png ADDED
Binary file
assets/img/extensions/notices.png ADDED
Binary file
assets/img/extensions/online-users.png ADDED
Binary file
assets/img/extensions/private-content.png ADDED
Binary file
assets/img/extensions/private-messages.png ADDED
Binary file
assets/img/extensions/profile-completeness.png ADDED
Binary file
assets/img/extensions/real-time-notifications.png ADDED
Binary file
assets/img/extensions/social-activity.png ADDED
Binary file
assets/img/extensions/social-login.png ADDED
Binary file
assets/img/extensions/terms-conditions.png ADDED
Binary file
assets/img/extensions/user-bookmarks.png ADDED
Binary file
assets/img/extensions/user-photos.png ADDED
Binary file
assets/img/extensions/user-reviews.png ADDED
Binary file
assets/img/extensions/user-tags.png ADDED
Binary file
assets/img/extensions/verified-users.png ADDED
Binary file
assets/img/extensions/woocommerce.png ADDED
Binary file
assets/js/um-scripts.js CHANGED
@@ -1,8 +1,3 @@
1
- /*jQuery('body').on('error', '.um-avatar', function() {
2
- if( jQuery(this).data('load-error') != undefined ) return;
3
- jQuery(this).data('load-error', '1').attr('src', jQuery(this).data('default'));
4
- });*/
5
-
6
  function um_init_datetimepicker() {
7
  jQuery('.um-datepicker:not(.picker__input)').each(function(){
8
  elem = jQuery(this);
 
 
 
 
 
1
  function um_init_datetimepicker() {
2
  jQuery('.um-datepicker:not(.picker__input)').each(function(){
3
  elem = jQuery(this);
includes/admin/core/class-admin-settings.php CHANGED
@@ -133,56 +133,87 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
133
  )
134
  );
135
 
136
- $tabs = UM()->profile()->tabs_primary();
137
 
138
  foreach ( $tabs as $id => $tab ) {
139
 
140
- $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
141
- array(
142
- 'id' => 'profile_tab_' . $id,
143
- 'type' => 'checkbox',
144
- 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab ),
145
- 'conditional' => array( 'profile_menu', '=', 1 ),
146
- ),
147
- array(
148
- 'id' => 'profile_tab_' . $id . '_privacy',
149
- 'type' => 'select',
150
- 'label' => sprintf( __( 'Who can see %s Tab?', 'ultimate-member' ), $tab ),
151
- 'tooltip' => __( 'Select which users can view this tab.', 'ultimate-member' ),
152
- 'options' => UM()->profile()->tabs_privacy(),
153
- 'conditional' => array( 'profile_tab_' . $id, '=', 1 ),
154
- 'size' => 'small'
155
- ),
156
- array(
157
- 'id' => 'profile_tab_' . $id . '_roles',
158
- 'type' => 'select',
159
- 'multi' => true,
160
- 'label' => __( 'Allowed roles','ultimate-member' ),
161
- 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ),
162
- 'options' => UM()->roles()->get_roles(),
163
- 'placeholder' => __( 'Choose user roles...','ultimate-member' ),
164
- 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ),
165
- 'size' => 'small'
166
- )
167
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  }
169
 
170
- $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
171
- array(
 
 
 
 
 
 
 
 
 
 
172
  'id' => 'profile_menu_default_tab',
173
  'type' => 'select',
174
  'label' => __( 'Profile menu default tab', 'ultimate-member' ),
175
  'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ),
176
- 'options' => UM()->profile()->tabs_enabled(),
177
  'conditional' => array( 'profile_menu', '=', 1 ),
178
  'size' => 'small'
179
- ),
 
 
 
180
  array(
181
  'id' => 'profile_menu_icons',
182
  'type' => 'checkbox',
183
  'label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ),
184
  'conditional' => array( 'profile_menu', '=', 1 ),
185
- )
186
  ) );
187
 
188
  $post_types_options = array();
@@ -751,6 +782,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
751
  'tooltip' => __('You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member'),
752
  'upload_frame_title'=> __('Select Default Cover Photo', 'ultimate-member'),
753
  ),
 
 
 
 
 
 
754
  array(
755
  'id' => 'profile_photosize',
756
  'type' => 'text',
133
  )
134
  );
135
 
136
+ $tabs = UM()->profile()->tabs();
137
 
138
  foreach ( $tabs as $id => $tab ) {
139
 
140
+ if ( isset( $tab['hidden'] ) ) {
141
+ continue;
142
+ }
143
+
144
+ if ( isset( $tab['default_privacy'] ) ) {
145
+ $fields = array(
146
+ array(
147
+ 'id' => 'profile_tab_' . $id,
148
+ 'type' => 'checkbox',
149
+ 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
150
+ 'conditional' => array( 'profile_menu', '=', 1 ),
151
+ ),
152
+ );
153
+ } else {
154
+
155
+ $fields = array(
156
+ array(
157
+ 'id' => 'profile_tab_' . $id,
158
+ 'type' => 'checkbox',
159
+ 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
160
+ 'conditional' => array( 'profile_menu', '=', 1 ),
161
+ ),
162
+ array(
163
+ 'id' => 'profile_tab_' . $id . '_privacy',
164
+ 'type' => 'select',
165
+ 'label' => sprintf( __( 'Who can see %s Tab?', 'ultimate-member' ), $tab['name'] ),
166
+ 'tooltip' => __( 'Select which users can view this tab.', 'ultimate-member' ),
167
+ 'options' => UM()->profile()->tabs_privacy(),
168
+ 'conditional' => array( 'profile_tab_' . $id, '=', 1 ),
169
+ 'size' => 'small'
170
+ ),
171
+ array(
172
+ 'id' => 'profile_tab_' . $id . '_roles',
173
+ 'type' => 'select',
174
+ 'multi' => true,
175
+ 'label' => __( 'Allowed roles','ultimate-member' ),
176
+ 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ),
177
+ 'options' => UM()->roles()->get_roles(),
178
+ 'placeholder' => __( 'Choose user roles...','ultimate-member' ),
179
+ 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ),
180
+ 'size' => 'small'
181
+ )
182
+ );
183
+ }
184
+
185
+ $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, $fields );
186
  }
187
 
188
+ $active_tabs = array();
189
+ $tabs = UM()->profile()->tabs_active();
190
+ if ( ! empty( $tabs ) ) {
191
+ foreach ( $tabs as $id => $info ) {
192
+ if ( isset( $info['name'] ) ) {
193
+ $active_tabs[ $id ] = $info['name'];
194
+ }
195
+ }
196
+ }
197
+
198
+ if ( count( $active_tabs ) ) {
199
+ $appearances_profile_menu_fields[] = array(
200
  'id' => 'profile_menu_default_tab',
201
  'type' => 'select',
202
  'label' => __( 'Profile menu default tab', 'ultimate-member' ),
203
  'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ),
204
+ 'options' => $active_tabs,
205
  'conditional' => array( 'profile_menu', '=', 1 ),
206
  'size' => 'small'
207
+ );
208
+ }
209
+
210
+ $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
211
  array(
212
  'id' => 'profile_menu_icons',
213
  'type' => 'checkbox',
214
  'label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ),
215
  'conditional' => array( 'profile_menu', '=', 1 ),
216
+ ),
217
  ) );
218
 
219
  $post_types_options = array();
782
  'tooltip' => __('You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member'),
783
  'upload_frame_title'=> __('Select Default Cover Photo', 'ultimate-member'),
784
  ),
785
+ array(
786
+ 'id' => 'disable_profile_photo_upload',
787
+ 'type' => 'checkbox',
788
+ 'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
789
+ 'tooltip' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ),
790
+ ),
791
  array(
792
  'id' => 'profile_photosize',
793
  'type' => 'text',
includes/admin/templates/access/restrict_content.php CHANGED
@@ -19,6 +19,12 @@ if ( ! defined( 'ABSPATH' ) ) exit;
19
  }
20
  }
21
 
 
 
 
 
 
 
22
  /**
23
  * UM hook
24
  *
@@ -42,96 +48,108 @@ if ( ! defined( 'ABSPATH' ) ) exit;
42
  */
43
  $fields = apply_filters( 'um_admin_access_settings_fields', array(
44
  array(
45
- 'id' => '_um_custom_access_settings',
46
- 'type' => 'checkbox',
47
- 'label' => __( 'Restrict access to this content?', 'ultimate-member' ),
48
- 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
49
- 'value' => ! empty( $data['_um_custom_access_settings'] ) ? $data['_um_custom_access_settings'] : 0,
50
  ),
51
  array(
52
- 'id' => '_um_accessible',
53
- 'type' => 'select',
54
- 'label' => __( 'Who can access this content?', 'ultimate-member' ),
55
- 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
56
- 'value' => ! empty( $data['_um_accessible'] ) ? $data['_um_accessible'] : 0,
57
- 'options' => array(
58
- '0' => __( 'Everyone', 'ultimate-member' ),
59
- '1' => __( 'Logged out users', 'ultimate-member' ),
60
- '2' => __( 'Logged in users', 'ultimate-member' ),
61
  ),
62
- 'conditional' => array( '_um_custom_access_settings', '=', '1' )
63
  ),
64
  array(
65
- 'id' => '_um_access_roles',
66
- 'type' => 'multi_checkbox',
67
- 'label' => __( 'Select which roles can access this content', 'ultimate-member' ),
68
- 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
69
- 'value' => $_um_access_roles_value,
70
- 'options' => UM()->roles()->get_roles( false, array( 'administrator' ) ),
71
  'columns' => 3,
72
- 'conditional' => array( '_um_accessible', '=', '2' )
73
  ),
74
  array(
75
- 'id' => '_um_noaccess_action',
76
- 'type' => 'select',
77
- 'label' => __( 'What happens when users without access tries to view the content?', 'ultimate-member' ),
78
- 'tooltip' => __( 'Action when users without access tries to view the content', 'ultimate-member' ),
79
- 'value' => ! empty( $data['_um_noaccess_action'] ) ? $data['_um_noaccess_action'] : 0,
80
- 'options' => array(
81
- '0' => __( 'Show access restricted message', 'ultimate-member' ),
82
- '1' => __( 'Redirect user', 'ultimate-member' ),
83
  ),
84
- 'conditional' => array( '_um_accessible', '!=', '0' )
85
  ),
86
  array(
87
- 'id' => '_um_restrict_by_custom_message',
88
- 'type' => 'select',
89
- 'label' => __( 'Would you like to use the global default message or apply a custom message to this content?', 'ultimate-member' ),
90
- 'tooltip' => __( 'Action when users without access tries to view the content', 'ultimate-member' ),
91
- 'value' => ! empty( $data['_um_restrict_by_custom_message'] ) ? $data['_um_restrict_by_custom_message'] : '0',
92
- 'options' => array(
93
- '0' => __( 'Global default message (default)', 'ultimate-member' ),
94
- '1' => __( 'Custom message', 'ultimate-member' ),
95
  ),
96
- 'conditional' => array( '_um_noaccess_action', '=', '0' )
97
  ),
98
  array(
99
- 'id' => '_um_restrict_custom_message',
100
- 'type' => 'wp_editor',
101
- 'label' => __( 'Custom Restrict Content message', 'ultimate-member' ),
102
- 'tooltip' => __( 'Changed global restrict message', 'ultimate-member' ),
103
- 'value' => ! empty( $data['_um_restrict_custom_message'] ) ? $data['_um_restrict_custom_message'] : '',
104
- 'conditional' => array( '_um_restrict_by_custom_message', '=', '1' )
105
  ),
106
  array(
107
- 'id' => '_um_access_redirect',
108
- 'type' => 'select',
109
- 'label' => __( 'Where should users be redirected to?', 'ultimate-member' ),
110
- 'tooltip' => __( 'Select redirect to page when user hasn\'t access to content', 'ultimate-member' ),
111
- 'value' => ! empty( $data['_um_access_redirect'] ) ? $data['_um_access_redirect'] : '0',
112
- 'conditional' => array( '_um_noaccess_action', '=', '1' ),
113
- 'options' => array(
114
- '0' => __( 'Login page', 'ultimate-member' ),
115
- '1' => __( 'Custom URL', 'ultimate-member' ),
116
  ),
117
  ),
118
  array(
119
- 'id' => '_um_access_redirect_url',
120
- 'type' => 'text',
121
- 'label' => __( 'Redirect URL', 'ultimate-member' ),
122
- 'tooltip' => __( 'Changed global restrict message', 'ultimate-member' ),
123
- 'value' => ! empty( $data['_um_access_redirect_url'] ) ? $data['_um_access_redirect_url'] : '',
124
- 'conditional' => array( '_um_access_redirect', '=', '1' )
125
  ),
126
  array(
127
- 'id' => '_um_access_hide_from_queries',
128
- 'type' => 'checkbox',
129
- 'label' => __( 'Hide from queries', 'ultimate-member' ),
130
- 'tooltip' => __( 'Hide this content from archives, RSS feeds etc for users who do not have permission to view this content', 'ultimate-member' ),
131
- 'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '',
132
- 'conditional' => array( '_um_accessible', '!=', '0' )
133
  )
134
- ), $data );
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  UM()->admin_forms( array(
137
  'class' => 'um-restrict-content um-third-column',
19
  }
20
  }
21
 
22
+ if ( ! empty( $object->post_type ) ) {
23
+ $post_type_object = get_post_type_object( $object->post_type );
24
+ } else {
25
+ $post_type_object = array();
26
+ }
27
+
28
  /**
29
  * UM hook
30
  *
48
  */
49
  $fields = apply_filters( 'um_admin_access_settings_fields', array(
50
  array(
51
+ 'id' => '_um_custom_access_settings',
52
+ 'type' => 'checkbox',
53
+ 'label' => __( 'Restrict access to this content?', 'ultimate-member' ),
54
+ 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
55
+ 'value' => ! empty( $data['_um_custom_access_settings'] ) ? $data['_um_custom_access_settings'] : 0,
56
  ),
57
  array(
58
+ 'id' => '_um_accessible',
59
+ 'type' => 'select',
60
+ 'label' => __( 'Who can access this content?', 'ultimate-member' ),
61
+ 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
62
+ 'value' => ! empty( $data['_um_accessible'] ) ? $data['_um_accessible'] : 0,
63
+ 'options' => array(
64
+ '0' => __( 'Everyone', 'ultimate-member' ),
65
+ '1' => __( 'Logged out users', 'ultimate-member' ),
66
+ '2' => __( 'Logged in users', 'ultimate-member' ),
67
  ),
68
+ 'conditional' => array( '_um_custom_access_settings', '=', '1' )
69
  ),
70
  array(
71
+ 'id' => '_um_access_roles',
72
+ 'type' => 'multi_checkbox',
73
+ 'label' => __( 'Select which roles can access this content', 'ultimate-member' ),
74
+ 'tooltip' => __( 'Activate content restriction for this post', 'ultimate-member' ),
75
+ 'value' => $_um_access_roles_value,
76
+ 'options' => UM()->roles()->get_roles( false, array( 'administrator' ) ),
77
  'columns' => 3,
78
+ 'conditional' => array( '_um_accessible', '=', '2' )
79
  ),
80
  array(
81
+ 'id' => '_um_noaccess_action',
82
+ 'type' => 'select',
83
+ 'label' => __( 'What happens when users without access tries to view the content?', 'ultimate-member' ),
84
+ 'tooltip' => __( 'Action when users without access tries to view the content', 'ultimate-member' ),
85
+ 'value' => ! empty( $data['_um_noaccess_action'] ) ? $data['_um_noaccess_action'] : 0,
86
+ 'options' => array(
87
+ '0' => __( 'Show access restricted message', 'ultimate-member' ),
88
+ '1' => __( 'Redirect user', 'ultimate-member' ),
89
  ),
90
+ 'conditional' => array( '_um_accessible', '!=', '0' )
91
  ),
92
  array(
93
+ 'id' => '_um_restrict_by_custom_message',
94
+ 'type' => 'select',
95
+ 'label' => __( 'Would you like to use the global default message or apply a custom message to this content?', 'ultimate-member' ),
96
+ 'tooltip' => __( 'Action when users without access tries to view the content', 'ultimate-member' ),
97
+ 'value' => ! empty( $data['_um_restrict_by_custom_message'] ) ? $data['_um_restrict_by_custom_message'] : '0',
98
+ 'options' => array(
99
+ '0' => __( 'Global default message (default)', 'ultimate-member' ),
100
+ '1' => __( 'Custom message', 'ultimate-member' ),
101
  ),
102
+ 'conditional' => array( '_um_noaccess_action', '=', '0' )
103
  ),
104
  array(
105
+ 'id' => '_um_restrict_custom_message',
106
+ 'type' => 'wp_editor',
107
+ 'label' => __( 'Custom Restrict Content message', 'ultimate-member' ),
108
+ 'tooltip' => __( 'Changed global restrict message', 'ultimate-member' ),
109
+ 'value' => ! empty( $data['_um_restrict_custom_message'] ) ? $data['_um_restrict_custom_message'] : '',
110
+ 'conditional' => array( '_um_restrict_by_custom_message', '=', '1' )
111
  ),
112
  array(
113
+ 'id' => '_um_access_redirect',
114
+ 'type' => 'select',
115
+ 'label' => __( 'Where should users be redirected to?', 'ultimate-member' ),
116
+ 'tooltip' => __( 'Select redirect to page when user hasn\'t access to content', 'ultimate-member' ),
117
+ 'value' => ! empty( $data['_um_access_redirect'] ) ? $data['_um_access_redirect'] : '0',
118
+ 'conditional' => array( '_um_noaccess_action', '=', '1' ),
119
+ 'options' => array(
120
+ '0' => __( 'Login page', 'ultimate-member' ),
121
+ '1' => __( 'Custom URL', 'ultimate-member' ),
122
  ),
123
  ),
124
  array(
125
+ 'id' => '_um_access_redirect_url',
126
+ 'type' => 'text',
127
+ 'label' => __( 'Redirect URL', 'ultimate-member' ),
128
+ 'tooltip' => __( 'Changed global restrict message', 'ultimate-member' ),
129
+ 'value' => ! empty( $data['_um_access_redirect_url'] ) ? $data['_um_access_redirect_url'] : '',
130
+ 'conditional' => array( '_um_access_redirect', '=', '1' )
131
  ),
132
  array(
133
+ 'id' => '_um_access_hide_from_queries',
134
+ 'type' => 'checkbox',
135
+ 'label' => __( 'Hide from queries', 'ultimate-member' ),
136
+ 'tooltip' => __( 'Hide this content from archives, RSS feeds etc for users who do not have permission to view this content', 'ultimate-member' ),
137
+ 'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '',
138
+ 'conditional' => array( '_um_accessible', '!=', '0' )
139
  )
140
+ ), $data, $object, $post_type_object );
141
+
142
+ // Hierarchical
143
+ // if ( $post_type_object->hierarchical ) {
144
+ // $fields[] = array(
145
+ // 'id' => '_um_access_hierarchical',
146
+ // 'type' => 'checkbox',
147
+ // 'label' => __( 'Hierarchical', 'ultimate-member' ),
148
+ // 'tooltip' => __( 'Use parent page settings for the child pages that doesn\'t have own restriction settings.', 'ultimate-member' ),
149
+ // 'value' => empty( $data['_um_access_hierarchical'] ) ? 0 : $data['_um_access_hierarchical'],
150
+ // 'conditional' => array( '_um_custom_access_settings', '=', '1' )
151
+ // );
152
+ // }
153
 
154
  UM()->admin_forms( array(
155
  'class' => 'um-restrict-content um-third-column',
includes/admin/templates/extensions.php CHANGED
@@ -2,91 +2,78 @@
2
 
3
  $premium['bbpress'] = array(
4
  'url' => 'https://ultimatemember.com/extensions/bbpress/',
5
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/bbpress.png',
6
  'name' => 'bbPress',
7
  'desc' => 'With the bbPress extension you can integrate Ultimate Member with bbPress',
8
  );
9
 
10
  $premium['profile-completeness'] = array(
11
  'url' => 'https://ultimatemember.com/extensions/profile-completeness/',
12
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/profile-completeness.png',
13
  'name' => 'Profile Completeness',
14
  'desc' => 'Encourage or force users to complete their profile on your site',
15
  );
16
 
17
  $premium['verified-users'] = array(
18
  'url' => 'https://ultimatemember.com/extensions/verified-users/',
19
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/verified-users.png',
20
  'name' => 'Verified Users',
21
  'desc' => 'Add a user verficiation system to your site so user accounts can be verified',
22
  );
23
 
24
  $premium['friends'] = array(
25
  'url' => 'https://ultimatemember.com/extensions/friends/',
26
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/friends.png',
27
  'name' => 'Friends',
28
  'desc' => 'Increase user interaction on your site by allowing users to become friends',
29
  );
30
 
31
  $premium['woocommerce'] = array(
32
  'url' => 'https://ultimatemember.com/extensions/woocommerce/',
33
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/woocommerce.png',
34
  'name' => 'WooCommerce',
35
  'desc' => 'Integrates the popular e-commerce plugin WooCommerce with Ultimate Member',
36
  );
37
 
38
  $premium['notices'] = array(
39
  'url' => 'https://ultimatemember.com/extensions/notices/',
40
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/notices.png',
41
  'name' => 'Notices',
42
  'desc' => 'Alert users to important information using conditional notices',
43
  );
44
 
45
  $premium['followers'] = array(
46
  'url' => 'https://ultimatemember.com/extensions/followers/',
47
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/follow.png',
48
  'name' => 'Followers',
49
  'desc' => 'Increase user interaction on your site by allowing users to follow each other',
50
  );
51
 
52
  $premium['mycred'] = array(
53
  'url' => 'https://ultimatemember.com/extensions/mycred/',
54
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/mycred.png',
55
  'name' => 'myCRED',
56
  'desc' => 'With the myCRED extension you can integrate Ultimate Member with myCRED',
57
  );
58
 
59
  $premium['private-messages'] = array(
60
  'url' => 'https://ultimatemember.com/extensions/private-messages/',
61
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/private-messages.png',
62
  'name' => 'Private Messages',
63
  'desc' => 'Add a private messaging system to your site & allow users to message each other',
64
  );
65
 
66
  $premium['social-activity'] = array(
67
  'url' => 'https://ultimatemember.com/extensions/social-activity/',
68
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/social-activity.png',
69
  'name' => 'Social Activity',
70
  'desc' => 'Let users create public wall posts & see the activity of other users',
71
  );
72
 
73
  $premium['social-login'] = array(
74
  'url' => 'https://ultimatemember.com/extensions/social-login/',
75
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/social-login.png',
76
  'name' => 'Social Login',
77
  'desc' => 'Let users register & login to your site via Facebook, Twitter, G+, LinkedIn, and more',
78
  );
79
 
80
  $premium['instagram'] = array(
81
  'url' => 'https://ultimatemember.com/extensions/instagram/',
82
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/instagram.png',
83
  'name' => 'Instagram',
84
  'desc' => 'Allow users to show their Instagram photos on their profile',
85
  );
86
 
87
  $premium['user-tags'] = array(
88
  'url' => 'https://ultimatemember.com/extensions/user-tags/',
89
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/usertags.png',
90
  'name' => 'User Tags',
91
  'desc' => 'With this extension you can add a user tag system to your website',
92
  );
@@ -94,7 +81,6 @@ $premium['user-tags'] = array(
94
 
95
  $premium['mailchimp'] = array(
96
  'url' => 'https://ultimatemember.com/extensions/mailchimp/',
97
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/mailchimp.png',
98
  'name' => 'MailChimp',
99
  'desc' => 'Allow users to subscribe to your mailchimp lists when they signup on your site',
100
  );
@@ -102,63 +88,60 @@ $premium['mailchimp'] = array(
102
 
103
  $premium['user-reviews'] = array(
104
  'url' => 'https://ultimatemember.com/extensions/user-reviews/',
105
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/user-reviews.png',
106
  'name' => 'User Reviews',
107
  'desc' => 'Allow users to rate & review each other using a 5 star rate/review system',
108
  );
109
 
110
  $premium['real-time-notifications'] = array(
111
  'url' => 'https://ultimatemember.com/extensions/real-time-notifications/',
112
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/05/notifications.png',
113
  'name' => 'Real-time Notifications',
114
  'desc' => 'Add a notifications system to your site so users can receive real-time notifications',
115
  );
116
 
117
  $premium['private-content'] = array(
118
  'url' => 'https://ultimatemember.com/extensions/private-content/',
119
- 'image' => 'https://ultimatemember.com/wp-content/uploads/bb-plugin/cache/private-content-page-circle.png',
120
  'name' => 'Private Content',
121
  'desc' => 'Display private content to logged in users that only they can access',
122
  );
123
 
124
  $premium['groups'] = array(
125
  'url' => 'https://ultimatemember.com/extensions/groups/',
126
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/10/groupimage.png',
127
  'name' => 'Groups',
128
  'desc' => 'Allow users to create and join groups around shared topics, interests etc.',
129
  );
130
 
131
  $premium['user-photos'] = array(
132
  'url' => 'https://ultimatemember.com/extensions/user-photos/',
133
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/06/User-Photos.png',
134
  'name' => 'User Photos',
135
  'desc' => 'Allow users to upload photos to their profile',
136
  );
137
 
 
 
 
 
 
 
138
  $free['forumwp'] = array(
139
  'url' => 'https://ultimatemember.com/extensions/forumwp/',
140
- 'image' => 'https://ultimatemember.com/wp-content/uploads/bb-plugin/cache/um-forumwp-extension-circle.png',
141
  'name' => 'ForumWP',
142
  'desc' => 'Integrates Ultimate Member with the forum plugin <a href="https://forumwpplugin.com" target="_blank">ForumWP</a>',
143
  );
144
 
145
  $free['online-users'] = array(
146
  'url' => 'https://ultimatemember.com/extensions/online-users/',
147
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/07/Online-Users.png',
148
  'name' => 'Online Users',
149
  'desc' => 'Display online users on your site so users can see who is online'
150
  );
151
 
152
  $free['google-recaptcha'] = array(
153
  'url' => 'https://ultimatemember.com/extensions/google-recaptcha/',
154
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/07/google.png',
155
  'name' => 'Google reCAPTCHA',
156
  'desc' => 'Stop bots on your registration & login forms with Google reCAPTCHA',
157
  );
158
 
159
  $free['terms-conditions'] = array(
160
  'url' => 'https://ultimatemember.com/extensions/terms-conditions/',
161
- 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2017/07/terms-conditions.png',
162
  'name' => 'Terms & Conditions',
163
  'desc' => 'Add terms & conditions to your registration form',
164
  ); ?>
@@ -199,11 +182,11 @@ $free['terms-conditions'] = array(
199
  foreach ( $premium as $key => $info ) { ?>
200
 
201
  <div class="plugin-card">
202
- <a href="<?php echo $info['url']; ?>" class="plugin-image">
203
- <img src="<?php echo $info['image']; ?>" />
204
  </a>
205
  <div class="plugin-card-top">
206
- <h3><a href="<?php echo $info['url']; ?>"><?php echo $info['name']; ?></a></h3>
207
 
208
  <div class="desc column-description">
209
  <?php echo $info['desc']; ?>
@@ -234,7 +217,7 @@ $free['terms-conditions'] = array(
234
 
235
  <div class="plugin-card">
236
  <a href="<?php echo $info['url']; ?>" class="plugin-image">
237
- <img src="<?php echo $info['image']; ?>" />
238
  </a>
239
  <div class="plugin-card-top">
240
  <h3><a href="<?php echo $info['url']; ?>"><?php echo $info['name']; ?></a></h3>
2
 
3
  $premium['bbpress'] = array(
4
  'url' => 'https://ultimatemember.com/extensions/bbpress/',
 
5
  'name' => 'bbPress',
6
  'desc' => 'With the bbPress extension you can integrate Ultimate Member with bbPress',
7
  );
8
 
9
  $premium['profile-completeness'] = array(
10
  'url' => 'https://ultimatemember.com/extensions/profile-completeness/',
 
11
  'name' => 'Profile Completeness',
12
  'desc' => 'Encourage or force users to complete their profile on your site',
13
  );
14
 
15
  $premium['verified-users'] = array(
16
  'url' => 'https://ultimatemember.com/extensions/verified-users/',
 
17
  'name' => 'Verified Users',
18
  'desc' => 'Add a user verficiation system to your site so user accounts can be verified',
19
  );
20
 
21
  $premium['friends'] = array(
22
  'url' => 'https://ultimatemember.com/extensions/friends/',
 
23
  'name' => 'Friends',
24
  'desc' => 'Increase user interaction on your site by allowing users to become friends',
25
  );
26
 
27
  $premium['woocommerce'] = array(
28
  'url' => 'https://ultimatemember.com/extensions/woocommerce/',
 
29
  'name' => 'WooCommerce',
30
  'desc' => 'Integrates the popular e-commerce plugin WooCommerce with Ultimate Member',
31
  );
32
 
33
  $premium['notices'] = array(
34
  'url' => 'https://ultimatemember.com/extensions/notices/',
 
35
  'name' => 'Notices',
36
  'desc' => 'Alert users to important information using conditional notices',
37
  );
38
 
39
  $premium['followers'] = array(
40
  'url' => 'https://ultimatemember.com/extensions/followers/',
 
41
  'name' => 'Followers',
42
  'desc' => 'Increase user interaction on your site by allowing users to follow each other',
43
  );
44
 
45
  $premium['mycred'] = array(
46
  'url' => 'https://ultimatemember.com/extensions/mycred/',
 
47
  'name' => 'myCRED',
48
  'desc' => 'With the myCRED extension you can integrate Ultimate Member with myCRED',
49
  );
50
 
51
  $premium['private-messages'] = array(
52
  'url' => 'https://ultimatemember.com/extensions/private-messages/',
 
53
  'name' => 'Private Messages',
54
  'desc' => 'Add a private messaging system to your site & allow users to message each other',
55
  );
56
 
57
  $premium['social-activity'] = array(
58
  'url' => 'https://ultimatemember.com/extensions/social-activity/',
 
59
  'name' => 'Social Activity',
60
  'desc' => 'Let users create public wall posts & see the activity of other users',
61
  );
62
 
63
  $premium['social-login'] = array(
64
  'url' => 'https://ultimatemember.com/extensions/social-login/',
 
65
  'name' => 'Social Login',
66
  'desc' => 'Let users register & login to your site via Facebook, Twitter, G+, LinkedIn, and more',
67
  );
68
 
69
  $premium['instagram'] = array(
70
  'url' => 'https://ultimatemember.com/extensions/instagram/',
 
71
  'name' => 'Instagram',
72
  'desc' => 'Allow users to show their Instagram photos on their profile',
73
  );
74
 
75
  $premium['user-tags'] = array(
76
  'url' => 'https://ultimatemember.com/extensions/user-tags/',
 
77
  'name' => 'User Tags',
78
  'desc' => 'With this extension you can add a user tag system to your website',
79
  );
81
 
82
  $premium['mailchimp'] = array(
83
  'url' => 'https://ultimatemember.com/extensions/mailchimp/',
 
84
  'name' => 'MailChimp',
85
  'desc' => 'Allow users to subscribe to your mailchimp lists when they signup on your site',
86
  );
88
 
89
  $premium['user-reviews'] = array(
90
  'url' => 'https://ultimatemember.com/extensions/user-reviews/',
 
91
  'name' => 'User Reviews',
92
  'desc' => 'Allow users to rate & review each other using a 5 star rate/review system',
93
  );
94
 
95
  $premium['real-time-notifications'] = array(
96
  'url' => 'https://ultimatemember.com/extensions/real-time-notifications/',
 
97
  'name' => 'Real-time Notifications',
98
  'desc' => 'Add a notifications system to your site so users can receive real-time notifications',
99
  );
100
 
101
  $premium['private-content'] = array(
102
  'url' => 'https://ultimatemember.com/extensions/private-content/',
 
103
  'name' => 'Private Content',
104
  'desc' => 'Display private content to logged in users that only they can access',
105
  );
106
 
107
  $premium['groups'] = array(
108
  'url' => 'https://ultimatemember.com/extensions/groups/',
 
109
  'name' => 'Groups',
110
  'desc' => 'Allow users to create and join groups around shared topics, interests etc.',
111
  );
112
 
113
  $premium['user-photos'] = array(
114
  'url' => 'https://ultimatemember.com/extensions/user-photos/',
 
115
  'name' => 'User Photos',
116
  'desc' => 'Allow users to upload photos to their profile',
117
  );
118
 
119
+ $premium['user-bookmarks'] = array(
120
+ 'url' => 'https://ultimatemember.com/extensions/user-bookmarks/',
121
+ 'name' => 'User Bookmarks',
122
+ 'desc' => 'Allow users to bookmark content from your website',
123
+ );
124
+
125
  $free['forumwp'] = array(
126
  'url' => 'https://ultimatemember.com/extensions/forumwp/',
 
127
  'name' => 'ForumWP',
128
  'desc' => 'Integrates Ultimate Member with the forum plugin <a href="https://forumwpplugin.com" target="_blank">ForumWP</a>',
129
  );
130
 
131
  $free['online-users'] = array(
132
  'url' => 'https://ultimatemember.com/extensions/online-users/',
 
133
  'name' => 'Online Users',
134
  'desc' => 'Display online users on your site so users can see who is online'
135
  );
136
 
137
  $free['google-recaptcha'] = array(
138
  'url' => 'https://ultimatemember.com/extensions/google-recaptcha/',
 
139
  'name' => 'Google reCAPTCHA',
140
  'desc' => 'Stop bots on your registration & login forms with Google reCAPTCHA',
141
  );
142
 
143
  $free['terms-conditions'] = array(
144
  'url' => 'https://ultimatemember.com/extensions/terms-conditions/',
 
145
  'name' => 'Terms & Conditions',
146
  'desc' => 'Add terms & conditions to your registration form',
147
  ); ?>
182
  foreach ( $premium as $key => $info ) { ?>
183
 
184
  <div class="plugin-card">
185
+ <a href="<?php echo esc_attr( $info['url'] ); ?>" class="plugin-image">
186
+ <img src="<?php echo esc_attr( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
187
  </a>
188
  <div class="plugin-card-top">
189
+ <h3><a href="<?php echo esc_attr( $info['url'] ); ?>"><?php echo $info['name']; ?></a></h3>
190
 
191
  <div class="desc column-description">
192
  <?php echo $info['desc']; ?>
217
 
218
  <div class="plugin-card">
219
  <a href="<?php echo $info['url']; ?>" class="plugin-image">
220
+ <img src="<?php echo esc_attr( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
221
  </a>
222
  <div class="plugin-card-top">
223
  <h3><a href="<?php echo $info['url']; ?>"><?php echo $info['name']; ?></a></h3>
includes/admin/templates/form/profile_customize.php CHANGED
@@ -123,45 +123,57 @@
123
  'conditional' => array( '_um_profile_cover_enabled', '=', 1 )
124
  ),
125
  array(
126
- 'id' => '_um_profile_photosize',
127
- 'type' => 'text',
128
- 'label' => __( 'Profile Photo Size', 'ultimate-member' ),
129
- 'tooltip' => __( 'Set the profile photo size in pixels here', 'ultimate-member' ),
130
- 'value' => UM()->query()->get_meta_value( '_um_profile_photosize', null, UM()->options()->get( 'profile_photosize' ) ),
131
- 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 )
 
 
 
 
132
  ),
133
  array(
134
- 'id' => '_um_profile_photo_required',
135
- 'type' => 'select',
136
- 'label' => __( 'Make Profile Photo Required', 'ultimate-member' ),
137
- 'tooltip' => __( 'Require user to update a profile photo when updating their profile', 'ultimate-member' ),
138
- 'value' => UM()->query()->get_meta_value( '_um_profile_photo_required' ),
139
- 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
140
- 'options' => array(
141
- 0 => __( 'No', 'ultimate-member' ),
142
- 1 => __( 'Yes', 'ultimate-member' ),
 
 
 
 
 
 
 
 
143
  ),
144
  ),
145
  array(
146
- 'id' => '_um_profile_show_name',
147
- 'type' => 'select',
148
- 'label' => __( 'Show display name in profile header?', 'ultimate-member' ),
149
- 'value' => UM()->query()->get_meta_value( '_um_profile_show_name', null, 1 ),
150
- 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
151
- 'options' => array(
152
- 0 => __( 'No', 'ultimate-member' ),
153
- 1 => __( 'Yes', 'ultimate-member' ),
154
  ),
155
  ),
156
  array(
157
- 'id' => '_um_profile_show_social_links',
158
- 'type' => 'select',
159
- 'label' => __( 'Show social links in profile header?', 'ultimate-member' ),
160
- 'value' => UM()->query()->get_meta_value( '_um_profile_show_social_links', null, UM()->options()->get( 'profile_show_social_links' ) ),
161
- 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
162
- 'options' => array(
163
- 0 => __( 'No', 'ultimate-member' ),
164
- 1 => __( 'Yes', 'ultimate-member' ),
165
  ),
166
  ),
167
  array(
123
  'conditional' => array( '_um_profile_cover_enabled', '=', 1 )
124
  ),
125
  array(
126
+ 'id' => '_um_profile_disable_photo_upload',
127
+ 'type' => 'select',
128
+ 'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
129
+ 'tooltip' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ),
130
+ 'value' => UM()->query()->get_meta_value( '_um_profile_disable_photo_upload', null, UM()->options()->get( 'disable_profile_photo_upload' ) ),
131
+ 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
132
+ 'options' => array(
133
+ 0 => __( 'No', 'ultimate-member' ),
134
+ 1 => __( 'Yes', 'ultimate-member' ),
135
+ ),
136
  ),
137
  array(
138
+ 'id' => '_um_profile_photosize',
139
+ 'type' => 'text',
140
+ 'label' => __( 'Profile Photo Size', 'ultimate-member' ),
141
+ 'tooltip' => __( 'Set the profile photo size in pixels here', 'ultimate-member' ),
142
+ 'value' => UM()->query()->get_meta_value( '_um_profile_photosize', null, UM()->options()->get( 'profile_photosize' ) ),
143
+ 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 )
144
+ ),
145
+ array(
146
+ 'id' => '_um_profile_photo_required',
147
+ 'type' => 'select',
148
+ 'label' => __( 'Make Profile Photo Required', 'ultimate-member' ),
149
+ 'tooltip' => __( 'Require user to update a profile photo when updating their profile', 'ultimate-member' ),
150
+ 'value' => UM()->query()->get_meta_value( '_um_profile_photo_required' ),
151
+ 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
152
+ 'options' => array(
153
+ 0 => __( 'No', 'ultimate-member' ),
154
+ 1 => __( 'Yes', 'ultimate-member' ),
155
  ),
156
  ),
157
  array(
158
+ 'id' => '_um_profile_show_name',
159
+ 'type' => 'select',
160
+ 'label' => __( 'Show display name in profile header?', 'ultimate-member' ),
161
+ 'value' => UM()->query()->get_meta_value( '_um_profile_show_name', null, 1 ),
162
+ 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
163
+ 'options' => array(
164
+ 0 => __( 'No', 'ultimate-member' ),
165
+ 1 => __( 'Yes', 'ultimate-member' ),
166
  ),
167
  ),
168
  array(
169
+ 'id' => '_um_profile_show_social_links',
170
+ 'type' => 'select',
171
+ 'label' => __( 'Show social links in profile header?', 'ultimate-member' ),
172
+ 'value' => UM()->query()->get_meta_value( '_um_profile_show_social_links', null, UM()->options()->get( 'profile_show_social_links' ) ),
173
+ 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
174
+ 'options' => array(
175
+ 0 => __( 'No', 'ultimate-member' ),
176
+ 1 => __( 'Yes', 'ultimate-member' ),
177
  ),
178
  ),
179
  array(
includes/class-config.php CHANGED
@@ -220,6 +220,7 @@ if ( ! class_exists( 'um\Config' ) ) {
220
  '_um_profile_align' => 'center',
221
  '_um_profile_icons' => 'label',
222
  '_um_profile_cover_enabled' => 1,
 
223
  '_um_profile_cover_ratio' => '2.7:1',
224
  '_um_profile_photosize' => '190px',
225
  '_um_profile_photocorner' => '1',
@@ -520,6 +521,7 @@ if ( ! class_exists( 'um\Config' ) ) {
520
  'blocked_words' => 'admin' . "\r\n" . 'administrator' . "\r\n" . 'webmaster' . "\r\n" . 'support' . "\r\n" . 'staff',
521
  'default_avatar' => '',
522
  'default_cover' => '',
 
523
  'profile_show_metaicon' => 0,
524
  'profile_menu' => 1,
525
  'profile_menu_default_tab' => 'main',
@@ -543,17 +545,20 @@ if ( ! class_exists( 'um\Config' ) ) {
543
 
544
  add_filter( 'um_get_tabs_from_config', '__return_true' );
545
 
546
- $tabs = UM()->profile()->tabs_primary();
547
  foreach ( $tabs as $id => $tab ) {
548
- $this->settings_defaults['profile_tab_' . $id] = 1;
549
- $this->settings_defaults['profile_tab_' . $id . '_privacy'] = 0;
550
- $this->settings_defaults['profile_tab_' . $id . '_roles'] = '';
 
 
 
551
  }
552
 
553
  foreach ( $this->email_notifications as $key => $notification ) {
554
- $this->settings_defaults[$key . '_on'] = ! empty( $notification['default_active'] );
555
- $this->settings_defaults[$key . '_sub'] = $notification['subject'];
556
- $this->settings_defaults[$key] = $notification['body'];
557
  }
558
 
559
  foreach ( $this->core_pages as $page_s => $page ) {
220
  '_um_profile_align' => 'center',
221
  '_um_profile_icons' => 'label',
222
  '_um_profile_cover_enabled' => 1,
223
+ '_um_profile_disable_photo_upload' => 0,
224
  '_um_profile_cover_ratio' => '2.7:1',
225
  '_um_profile_photosize' => '190px',
226
  '_um_profile_photocorner' => '1',
521
  'blocked_words' => 'admin' . "\r\n" . 'administrator' . "\r\n" . 'webmaster' . "\r\n" . 'support' . "\r\n" . 'staff',
522
  'default_avatar' => '',
523
  'default_cover' => '',
524
+ 'disable_profile_photo_upload' => 0,
525
  'profile_show_metaicon' => 0,
526
  'profile_menu' => 1,
527
  'profile_menu_default_tab' => 'main',
545
 
546
  add_filter( 'um_get_tabs_from_config', '__return_true' );
547
 
548
+ $tabs = UM()->profile()->tabs();
549
  foreach ( $tabs as $id => $tab ) {
550
+ $this->settings_defaults[ 'profile_tab_' . $id ] = 1;
551
+
552
+ if ( ! isset( $tab['default_privacy'] ) ) {
553
+ $this->settings_defaults[ 'profile_tab_' . $id . '_privacy' ] = 0;
554
+ $this->settings_defaults[ 'profile_tab_' . $id . '_roles' ] = '';
555
+ }
556
  }
557
 
558
  foreach ( $this->email_notifications as $key => $notification ) {
559
+ $this->settings_defaults[ $key . '_on' ] = ! empty( $notification['default_active'] );
560
+ $this->settings_defaults[ $key . '_sub' ] = $notification['subject'];
561
+ $this->settings_defaults[ $key ] = $notification['body'];
562
  }
563
 
564
  foreach ( $this->core_pages as $page_s => $page ) {
includes/class-dependencies.php CHANGED
@@ -60,12 +60,12 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
60
  'beaver-builder' => '2.0',
61
  'user-photos' => '2.0.1',
62
  'user-exporter' => '1.0.0',
63
- // 'bookmark' => '2.0',
64
  'user-events' => '1.0.0',
65
  'filesharing' => '1.0.0',
66
  'user-notes' => '2.0',
67
  'user-bookmarks' => '2.0',
68
  'unsplash' => '2.0',
 
69
  );
70
 
71
 
@@ -119,6 +119,20 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
119
  }
120
 
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  /**
123
  * Check if myCRED plugin is active
124
  *
60
  'beaver-builder' => '2.0',
61
  'user-photos' => '2.0.1',
62
  'user-exporter' => '1.0.0',
 
63
  'user-events' => '1.0.0',
64
  'filesharing' => '1.0.0',
65
  'user-notes' => '2.0',
66
  'user-bookmarks' => '2.0',
67
  'unsplash' => '2.0',
68
+ 'fmwp' => '2.0.1',
69
  );
70
 
71
 
119
  }
120
 
121
 
122
+ /**
123
+ * Check if ForumWP plugin is active
124
+ *
125
+ * @return bool
126
+ */
127
+ public static function forumwp_active_check() {
128
+
129
+ if ( ! self::$active_plugins ) self::init();
130
+
131
+ return in_array( 'forumwp/forumwp.php', self::$active_plugins ) || array_key_exists( 'forumwp/forumwp.php', self::$active_plugins );
132
+
133
+ }
134
+
135
+
136
  /**
137
  * Check if myCRED plugin is active
138
  *
includes/class-init.php CHANGED
@@ -36,6 +36,7 @@ if ( ! class_exists( 'UM' ) ) {
36
  * @method UM_Notes Notes()
37
  * @method UM_User_Bookmarks User_Bookmarks()
38
  * @method UM_Unsplash Unsplash()
 
39
  */
40
  final class UM extends UM_Functions {
41
 
36
  * @method UM_Notes Notes()
37
  * @method UM_User_Bookmarks User_Bookmarks()
38
  * @method UM_Unsplash Unsplash()
39
+ * @method UM_FMWP FMWP()
40
  */
41
  final class UM extends UM_Functions {
42
 
includes/core/class-access.php CHANGED
@@ -1227,7 +1227,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
1227
  }
1228
  }
1229
 
1230
- $has_thumbnail = apply_filters("um_restrict_post_thumbnail", $has_thumbnail, $post, $thumbnail_id );
1231
 
1232
  return $has_thumbnail;
1233
  }
1227
  }
1228
  }
1229
 
1230
+ $has_thumbnail = apply_filters( 'um_restrict_post_thumbnail', $has_thumbnail, $post, $thumbnail_id );
1231
 
1232
  return $has_thumbnail;
1233
  }
includes/core/class-enqueue.php CHANGED
@@ -109,7 +109,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
109
 
110
  wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false );
111
  wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
112
- 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' ), ultimatemember_version, true );
113
  /**
114
  * UM hook
115
  *
109
 
110
  wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false );
111
  wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
112
+ 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 );
113
  /**
114
  * UM hook
115
  *
includes/core/class-fields.php CHANGED
@@ -879,6 +879,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
879
  }
880
  }
881
 
 
882
  /**
883
  * UM hook
884
  *
@@ -887,7 +888,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
887
  * @description Change is selected filter value
888
  * @input_vars
889
  * [{"var":"$value","type":"string","desc":"Selected filter value"},
890
- * {"var":"$key","type":"string","desc":"Selected filter key"}]
 
891
  * @change_log
892
  * ["Since: 2.0"]
893
  * @usage add_filter( 'um_is_selected_filter_value', 'function_name', 10, 2 );
@@ -900,7 +902,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
900
  * }
901
  * ?>
902
  */
903
- $field_value = apply_filters( 'um_is_selected_filter_value', $field_value, $key );
904
 
905
  /**
906
  * UM hook
@@ -1064,20 +1066,29 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1064
  * @param array $data
1065
  * @param string $type
1066
  *
1067
- * @return json
1068
  */
1069
  function get_option_value_from_callback( $value, $data, $type ) {
1070
 
 
1071
  if ( in_array( $type, array( 'select', 'multiselect' ) ) && ! empty( $data['custom_dropdown_options_source'] ) ) {
1072
 
1073
- if ( function_exists( $data['custom_dropdown_options_source'] ) ) {
 
 
 
 
 
 
 
1074
 
1075
  $arr_options = call_user_func(
1076
  $data['custom_dropdown_options_source'],
1077
  ( ! empty( $data['parent_dropdown_relationship'] ) ? $data['parent_dropdown_relationship'] : '' )
1078
  );
 
1079
 
1080
-
1081
  if ( $type == 'select' ) {
1082
  if ( ! empty( $arr_options[ $value ] ) ) {
1083
  return $arr_options[ $value ];
@@ -1086,9 +1097,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1086
  } else {
1087
  return '';
1088
  }
1089
- }
1090
-
1091
- if ( $type == 'multiselect' ) {
1092
 
1093
  if ( is_array( $value ) ) {
1094
  $values = $value;
@@ -1106,7 +1115,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
1106
 
1107
  return implode( ', ', $arr_paired_options );
1108
  }
1109
-
1110
  }
1111
 
1112
 
879
  }
880
  }
881
 
882
+
883
  /**
884
  * UM hook
885
  *
888
  * @description Change is selected filter value
889
  * @input_vars
890
  * [{"var":"$value","type":"string","desc":"Selected filter value"},
891
+ * {"var":"$key","type":"string","desc":"Selected filter key"},
892
+ * {"var":"$value","type":"string","desc":"Selected filter value"}]
893
  * @change_log
894
  * ["Since: 2.0"]
895
  * @usage add_filter( 'um_is_selected_filter_value', 'function_name', 10, 2 );
902
  * }
903
  * ?>
904
  */
905
+ $field_value = apply_filters( 'um_is_selected_filter_value', $field_value, $key, $value );
906
 
907
  /**
908
  * UM hook
1066
  * @param array $data
1067
  * @param string $type
1068
  *
1069
+ * @return string
1070
  */
1071
  function get_option_value_from_callback( $value, $data, $type ) {
1072
 
1073
+
1074
  if ( in_array( $type, array( 'select', 'multiselect' ) ) && ! empty( $data['custom_dropdown_options_source'] ) ) {
1075
 
1076
+ $has_custom_source = apply_filters( "um_has_dropdown_options_source__{$data['metakey']}", false );
1077
+
1078
+ if ( $has_custom_source ) {
1079
+
1080
+ $opts = apply_filters( "um_get_field__{$data['metakey']}", array() );
1081
+ $arr_options = $opts['options'];
1082
+
1083
+ } elseif ( function_exists( $data['custom_dropdown_options_source'] ) ) {
1084
 
1085
  $arr_options = call_user_func(
1086
  $data['custom_dropdown_options_source'],
1087
  ( ! empty( $data['parent_dropdown_relationship'] ) ? $data['parent_dropdown_relationship'] : '' )
1088
  );
1089
+ }
1090
 
1091
+ if ( $has_custom_source || function_exists( $data['custom_dropdown_options_source'] ) ) {
1092
  if ( $type == 'select' ) {
1093
  if ( ! empty( $arr_options[ $value ] ) ) {
1094
  return $arr_options[ $value ];
1097
  } else {
1098
  return '';
1099
  }
1100
+ } elseif ( $type == 'multiselect' ) {
 
 
1101
 
1102
  if ( is_array( $value ) ) {
1103
  $values = $value;
1115
 
1116
  return implode( ', ', $arr_paired_options );
1117
  }
 
1118
  }
1119
 
1120
 
includes/core/class-mail.php CHANGED
@@ -406,7 +406,7 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
406
  }
407
 
408
  $this->attachments = null;
409
- $this->headers = 'From: '. UM()->options()->get('mail_from') .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n";
410
 
411
  /**
412
  * UM hook
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
  /**
412
  * UM hook
includes/core/class-profile.php CHANGED
@@ -77,6 +77,24 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
77
  }
78
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  /**
81
  * All tab data
82
  *
@@ -123,12 +141,12 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
123
  // disable private tabs
124
  if ( ! is_admin() ) {
125
  if ( is_user_logged_in() ) {
126
- $user_id = um_user('ID');
127
  um_fetch_user( get_current_user_id() );
128
  }
129
 
130
  foreach ( $tabs as $id => $tab ) {
131
- if ( ! $this->can_view_tab( $id ) ) {
132
  unset( $tabs[ $id ] );
133
  }
134
  }
@@ -142,94 +160,29 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
142
  }
143
 
144
 
145
- /**
146
- * Tabs that are active
147
- *
148
- * @return array
149
- */
150
- function tabs_active() {
151
- $tabs = $this->tabs();
152
-
153
- foreach ( $tabs as $id => $info ) {
154
- if ( ! UM()->options()->get( 'profile_tab_' . $id ) && ! isset( $info['_builtin'] ) && ! isset( $info['custom'] ) ) {
155
- unset( $tabs[ $id ] );
156
- }
157
- }
158
-
159
- return $tabs;
160
- }
161
-
162
-
163
- /**
164
- * Primary tabs only
165
- *
166
- * @return array
167
- */
168
- function tabs_primary() {
169
- $tabs = $this->tabs();
170
- $primary = array();
171
- foreach ( $tabs as $id => $info ) {
172
- if ( isset( $info['name'] ) ) {
173
- $primary[$id] = $info['name'];
174
- }
175
- }
176
- return $primary;
177
- }
178
-
179
-
180
- /**
181
- * Activated tabs in backend
182
- *
183
- * @return string
184
- */
185
- function tabs_enabled() {
186
- $tabs = $this->tabs();
187
- foreach ( $tabs as $id => $info ) {
188
- if ( isset( $info['name'] ) ) {
189
- if ( UM()->options()->get( 'profile_tab_' . $id ) || isset( $info['_builtin'] ) ) {
190
- $primary[ $id ] = $info['name'];
191
- }
192
- }
193
- }
194
- return isset( $primary ) ? $primary : '';
195
- }
196
-
197
-
198
- /**
199
- * Privacy options
200
- *
201
- * @return array
202
- */
203
- function tabs_privacy() {
204
- $privacy = array(
205
- 0 => 'Anyone',
206
- 1 => 'Guests only',
207
- 2 => 'Members only',
208
- 3 => 'Only the owner',
209
- 4 => 'Specific roles'
210
- );
211
-
212
- return $privacy;
213
- }
214
-
215
-
216
  /**
217
  * Check if the user can view the current tab
218
  *
219
- * @param $tab
 
220
  *
221
  * @return bool
222
  */
223
- function can_view_tab( $tab ) {
 
224
 
225
  $target_id = (int) UM()->user()->target_id;
226
  if ( empty( $target_id ) ) {
227
  return true;
228
  }
229
 
230
- $can_view = false;
 
 
 
 
231
 
232
- $privacy = intval( UM()->options()->get( 'profile_tab_' . $tab . '_privacy' ) );
233
  switch ( $privacy ) {
234
  case 0:
235
  $can_view = true;
@@ -249,7 +202,11 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
249
 
250
  case 4:
251
  if ( is_user_logged_in() ) {
252
- $roles = (array) UM()->options()->get( 'profile_tab_' . $tab . '_roles' );
 
 
 
 
253
 
254
  $current_user_roles = um_user( 'roles' );
255
  if ( ! empty( $current_user_roles ) && count( array_intersect( $current_user_roles, $roles ) ) > 0 ) {
@@ -267,6 +224,28 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
267
  }
268
 
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /**
271
  * Get active_tab
272
  *
77
  }
78
 
79
 
80
+ /**
81
+ * Pre-defined privacy options
82
+ *
83
+ * @return array
84
+ */
85
+ function tabs_privacy() {
86
+ $privacy = array(
87
+ 0 => __( 'Anyone', 'ultimate-member' ),
88
+ 1 => __( 'Guests only', 'ultimate-member' ),
89
+ 2 => __( 'Members only', 'ultimate-member' ),
90
+ 3 => __( 'Only the owner', 'ultimate-member' ),
91
+ 4 => __( 'Specific roles', 'ultimate-member' ),
92
+ );
93
+
94
+ return $privacy;
95
+ }
96
+
97
+
98
  /**
99
  * All tab data
100
  *
141
  // disable private tabs
142
  if ( ! is_admin() ) {
143
  if ( is_user_logged_in() ) {
144
+ $user_id = um_user( 'ID' );
145
  um_fetch_user( get_current_user_id() );
146
  }
147
 
148
  foreach ( $tabs as $id => $tab ) {
149
+ if ( ! $this->can_view_tab( $id, $tab ) ) {
150
  unset( $tabs[ $id ] );
151
  }
152
  }
160
  }
161
 
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  /**
164
  * Check if the user can view the current tab
165
  *
166
+ * @param string $tab
167
+ * @param array $tab_data
168
  *
169
  * @return bool
170
  */
171
+ function can_view_tab( $tab, $tab_data = array() ) {
172
+ $can_view = false;
173
 
174
  $target_id = (int) UM()->user()->target_id;
175
  if ( empty( $target_id ) ) {
176
  return true;
177
  }
178
 
179
+ if ( isset( $tab_data['default_privacy'] ) ) {
180
+ $privacy = $tab_data['default_privacy'];
181
+ } else {
182
+ $privacy = intval( UM()->options()->get( 'profile_tab_' . $tab . '_privacy' ) );
183
+ }
184
 
185
+ $privacy = apply_filters( 'um_profile_menu_tab_privacy', $privacy, $tab );
186
  switch ( $privacy ) {
187
  case 0:
188
  $can_view = true;
202
 
203
  case 4:
204
  if ( is_user_logged_in() ) {
205
+ if ( isset( $tab_data['default_privacy'] ) ) {
206
+ $roles = isset( $tab_data['default_privacy_roles'] ) ? $tab_data['default_privacy_roles'] : array();
207
+ } else {
208
+ $roles = (array) UM()->options()->get( 'profile_tab_' . $tab . '_roles' );
209
+ }
210
 
211
  $current_user_roles = um_user( 'roles' );
212
  if ( ! empty( $current_user_roles ) && count( array_intersect( $current_user_roles, $roles ) ) > 0 ) {
224
  }
225
 
226
 
227
+ /**
228
+ * Tabs that are active
229
+ *
230
+ * @return array
231
+ */
232
+ function tabs_active() {
233
+ $tabs = $this->tabs();
234
+
235
+ foreach ( $tabs as $id => $info ) {
236
+ if ( ! empty( $info['hidden'] ) ) {
237
+ continue;
238
+ }
239
+
240
+ if ( ! UM()->options()->get( 'profile_tab_' . $id ) ) {
241
+ unset( $tabs[ $id ] );
242
+ }
243
+ }
244
+
245
+ return $tabs;
246
+ }
247
+
248
+
249
  /**
250
  * Get active_tab
251
  *
includes/core/class-shortcodes.php CHANGED
@@ -36,9 +36,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
36
  add_shortcode( 'um_show_content', array( &$this, 'um_shortcode_show_content_for_role' ) );
37
  add_shortcode( 'ultimatemember_searchform', array( &$this, 'ultimatemember_searchform' ) );
38
 
39
-
40
  add_filter( 'body_class', array( &$this, 'body_class' ), 0 );
41
- add_action( 'template_redirect', array( &$this, 'is_um_page' ) );
42
 
43
  add_filter( 'um_shortcode_args_filter', array( &$this, 'display_logout_form' ), 99 );
44
  add_filter( 'um_shortcode_args_filter', array( &$this, 'parse_shortcode_args' ), 99 );
36
  add_shortcode( 'um_show_content', array( &$this, 'um_shortcode_show_content_for_role' ) );
37
  add_shortcode( 'ultimatemember_searchform', array( &$this, 'ultimatemember_searchform' ) );
38
 
 
39
  add_filter( 'body_class', array( &$this, 'body_class' ), 0 );
 
40
 
41
  add_filter( 'um_shortcode_args_filter', array( &$this, 'display_logout_form' ), 99 );
42
  add_filter( 'um_shortcode_args_filter', array( &$this, 'parse_shortcode_args' ), 99 );
includes/core/class-validation.php CHANGED
@@ -55,6 +55,10 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
55
  }
56
 
57
  foreach ( $changes as $key => $value ) {
 
 
 
 
58
  //rating field validation
59
  if ( isset( $fields[ $key ]['type'] ) && $fields[ $key ]['type'] == 'rating' ) {
60
  if ( ! is_numeric( $value ) ) {
@@ -74,7 +78,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
74
 
75
  //validation of correct values from options in wp-admin
76
  $stripslashes = $value;
77
- if( is_string( $value ) ){
78
  $stripslashes = stripslashes( $value );
79
  }
80
 
55
  }
56
 
57
  foreach ( $changes as $key => $value ) {
58
+ if ( ! isset( $fields[ $key ] ) ) {
59
+ continue;
60
+ }
61
+
62
  //rating field validation
63
  if ( isset( $fields[ $key ]['type'] ) && $fields[ $key ]['type'] == 'rating' ) {
64
  if ( ! is_numeric( $value ) ) {
78
 
79
  //validation of correct values from options in wp-admin
80
  $stripslashes = $value;
81
+ if ( is_string( $value ) ) {
82
  $stripslashes = stripslashes( $value );
83
  }
84
 
includes/core/um-actions-account.php CHANGED
@@ -409,15 +409,22 @@ add_action( 'um_before_account_delete', 'um_before_account_delete' );
409
 
410
  /**
411
  * Before notifications account tab content
 
 
412
  */
413
- function um_before_account_notifications() { ?>
414
- <div class="um-field">
415
- <div class="um-field-label">
416
- <label for=""><?php _e( 'Email me when', 'ultimate-member' ); ?></label>
417
- <div class="um-clear"></div>
 
 
 
 
418
  </div>
419
- </div>
420
- <?php }
 
421
  add_action( 'um_before_account_notifications', 'um_before_account_notifications' );
422
 
423
 
409
 
410
  /**
411
  * Before notifications account tab content
412
+ *
413
+ * @param array $args
414
  */
415
+ function um_before_account_notifications( $args = array() ) {
416
+ $output = UM()->account()->get_tab_fields( 'notifications', $args );
417
+ if ( substr_count( $output, '_enable_new_' ) ) { ?>
418
+
419
+ <div class="um-field">
420
+ <div class="um-field-label">
421
+ <label for=""><?php _e( 'Email me when', 'ultimate-member' ); ?></label>
422
+ <div class="um-clear"></div>
423
+ </div>
424
  </div>
425
+
426
+ <?php }
427
+ }
428
  add_action( 'um_before_account_notifications', 'um_before_account_notifications' );
429
 
430
 
includes/core/um-actions-profile.php CHANGED
@@ -216,7 +216,7 @@ function um_user_edit_profile( $args ) {
216
  do_action( 'um_user_before_updating_profile', $userinfo );
217
 
218
  if ( ! empty( $args['custom_fields'] ) ) {
219
- $fields = unserialize( $args['custom_fields'] );
220
  }
221
 
222
  // loop through fields
@@ -246,18 +246,42 @@ function um_user_edit_profile( $args ) {
246
  }
247
  }
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  //validation of correct values from options in wp-admin
250
- $stripslashes = stripslashes( $args['submitted'][ $key ] );
 
 
 
251
  if ( in_array( $array['type'], array( 'select' ) ) &&
252
- ! empty( $array['options'] ) && ! empty( $stripslashes ) &&
253
- ! in_array( $stripslashes, array_map( 'trim', $array['options'] ) ) ) {
254
  continue;
255
  }
256
 
257
  //validation of correct values from options in wp-admin
258
  //the user cannot set invalid value in the hidden input at the page
259
  if ( in_array( $array['type'], array( 'multiselect', 'checkbox', 'radio' ) ) &&
260
- ! empty( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) {
261
  $args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) );
262
  $args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) );
263
  }
@@ -296,6 +320,7 @@ function um_user_edit_profile( $args ) {
296
  }
297
  }
298
 
 
299
  if ( isset( $args['submitted']['description'] ) ) {
300
  $to_update['description'] = $args['submitted']['description'];
301
  }
@@ -528,7 +553,7 @@ function um_profile_dynamic_meta_desc() {
528
  $user_id = um_user( 'ID' );
529
 
530
  $url = um_user_profile_url();
531
- $avatar = um_get_user_avatar_url( $user_id, 'original' );
532
 
533
  um_reset_user(); ?>
534
 
@@ -568,7 +593,7 @@ function um_profile_header_cover_area( $args ) {
568
  ?>
569
 
570
  <div class="um-cover <?php if ( um_user( 'cover_photo' ) || ( $default_cover && $default_cover['url'] ) ) echo 'has-cover'; ?>"
571
- data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
572
 
573
  <?php
574
  /**
@@ -696,21 +721,27 @@ add_action( 'um_after_profile_header_name_args', 'um_social_links_icons', 50 );
696
  function um_profile_header( $args ) {
697
  $classes = null;
698
 
699
- if (!$args['cover_enabled']) {
700
  $classes .= ' no-cover';
701
  }
702
 
703
  $default_size = str_replace( 'px', '', $args['photosize'] );
704
 
705
- $overlay = '<span class="um-profile-photo-overlay">
 
 
 
 
 
 
 
706
  <span class="um-profile-photo-overlay-s">
707
  <ins>
708
  <i class="um-faicon-camera"></i>
709
  </ins>
710
  </span>
711
  </span>';
712
-
713
- ?>
714
 
715
  <div class="um-header<?php echo $classes; ?>">
716
 
@@ -741,9 +772,7 @@ function um_profile_header( $args ) {
741
  <a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"
742
  title="<?php echo um_user( 'display_name' ); ?>"><?php echo $overlay . get_avatar( um_user( 'ID' ), $default_size ); ?></a>
743
 
744
- <?php
745
-
746
- if ( ! isset( UM()->user()->cannot_edit ) ) {
747
 
748
  UM()->fields()->add_hidden_field( 'profile_photo' );
749
 
@@ -814,35 +843,33 @@ function um_profile_header( $args ) {
814
 
815
  }
816
 
817
- }
818
-
819
- ?>
820
 
821
  </div>
822
 
823
  <div class="um-profile-meta">
824
 
825
- <?php
826
- /**
827
- * UM hook
828
- *
829
- * @type action
830
- * @title um_before_profile_main_meta
831
- * @description Insert before profile main meta block
832
- * @input_vars
833
- * [{"var":"$args","type":"array","desc":"Form Arguments"}]
834
- * @change_log
835
- * ["Since: 2.0.1"]
836
- * @usage add_action( 'um_before_profile_main_meta', 'function_name', 10, 1 );
837
- * @example
838
- * <?php
839
- * add_action( 'um_before_profile_main_meta', 'my_before_profile_main_meta', 10, 1 );
840
- * function my_before_profile_main_meta( $args ) {
841
- * // your code here
842
- * }
843
- * ?>
844
- */
845
- do_action( 'um_before_profile_main_meta', $args ); ?>
846
 
847
  <div class="um-main-meta">
848
 
@@ -946,10 +973,10 @@ function um_profile_header( $args ) {
946
 
947
  <div class="um-meta-text">
948
  <textarea id="um-meta-bio"
949
- data-character-limit="<?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?>"
950
- placeholder="<?php _e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
951
- name="<?php echo 'description-' . $args['form_id']; ?>"
952
- id="<?php echo 'description-' . $args['form_id']; ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
953
  <span class="um-meta-bio-character um-right"><span
954
  class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
955
  <?php
@@ -1334,110 +1361,121 @@ function um_profile_menu( $args ) {
1334
  // Move default tab priority
1335
  $default_tab = UM()->options()->get( 'profile_menu_default_tab' );
1336
  $dtab = ( isset( $tabs[ $default_tab ] ) ) ? $tabs[ $default_tab ] : 'main';
1337
- if ( isset( $tabs[ $default_tab] ) ) {
1338
  unset( $tabs[ $default_tab ] );
1339
  $dtabs[ $default_tab ] = $dtab;
1340
  $tabs = $dtabs + $tabs;
1341
- } ?>
1342
 
1343
- <div class="um-profile-nav">
 
 
 
 
 
1344
 
1345
- <?php foreach ( $tabs as $id => $tab ) {
1346
 
1347
- if ( isset( $tab['hidden'] ) ) {
1348
- continue;
1349
- }
1350
 
1351
- $nav_link = UM()->permalinks()->get_current_url( get_option( 'permalink_structure' ) );
1352
- $nav_link = remove_query_arg( 'um_action', $nav_link );
1353
- $nav_link = remove_query_arg( 'subnav', $nav_link );
1354
- $nav_link = add_query_arg( 'profiletab', $id, $nav_link );
1355
 
1356
- /**
1357
- * UM hook
1358
- *
1359
- * @type filter
1360
- * @title um_profile_menu_link_{$id}
1361
- * @description Change profile menu link by tab $id
1362
- * @input_vars
1363
- * [{"var":"$nav_link","type":"string","desc":"Profile Tab Link"}]
1364
- * @change_log
1365
- * ["Since: 2.0"]
1366
- * @usage
1367
- * <?php add_filter( 'um_profile_menu_link_{$id}', 'function_name', 10, 1 ); ?>
1368
- * @example
1369
- * <?php
1370
- * add_filter( 'um_profile_menu_link_{$id}', 'my_profile_menu_link', 10, 1 );
1371
- * function my_profile_menu_link( $nav_link ) {
1372
- * // your code here
1373
- * return $nav_link;
1374
- * }
1375
- * ?>
1376
- */
1377
- $nav_link = apply_filters( "um_profile_menu_link_{$id}", $nav_link );
1378
 
1379
- $profile_nav_class = '';
1380
- if ( ! UM()->options()->get( 'profile_menu_icons' ) ) {
1381
- $profile_nav_class .= ' without-icon';
1382
- }
1383
 
1384
- if ( $id == $active_tab ) {
1385
- $profile_nav_class .= ' active';
1386
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1387
 
1388
- <div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
1389
- <?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
1390
- <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1391
- title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1392
 
1393
- <i class="<?php echo $tab['icon']; ?>"></i>
 
 
1394
 
1395
- <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1396
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1397
- <?php } ?>
 
1398
 
1399
- <span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo $tab['name']; ?></span>
1400
- </a>
1401
- <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1402
- title="<?php echo esc_attr( $tab['name'] ); ?>">
1403
 
1404
- <i class="<?php echo $tab['icon']; ?>"></i>
 
 
1405
 
1406
- <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1407
- <span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
1408
- <?php } ?>
 
1409
 
1410
- <span class="title"><?php echo $tab['name']; ?></span>
1411
- </a>
1412
- <?php } else { ?>
1413
- <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1414
- title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1415
 
1416
- <i class="<?php echo $tab['icon']; ?>"></i>
 
 
1417
 
1418
- <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1419
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1420
- <?php } ?>
1421
- </a>
1422
- <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1423
- title="<?php echo esc_attr( $tab['name'] ); ?>">
1424
 
1425
- <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
1426
- <span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
1427
- <?php } ?>
1428
 
1429
- <span class="title"><?php echo $tab['name']; ?></span>
1430
- </a>
1431
- <?php } ?>
1432
- </div>
 
 
1433
 
1434
- <?php } ?>
 
 
1435
 
1436
- <div class="um-clear"></div>
 
 
 
1437
 
1438
- </div>
 
 
 
 
 
 
1439
 
1440
- <?php foreach ( $tabs as $id => $tab ) {
1441
 
1442
  if ( isset( $tab['subnav'] ) && $active_tab == $id ) {
1443
 
216
  do_action( 'um_user_before_updating_profile', $userinfo );
217
 
218
  if ( ! empty( $args['custom_fields'] ) ) {
219
+ $fields = apply_filters( 'um_user_edit_profile_fields', unserialize( $args['custom_fields'] ), $args );
220
  }
221
 
222
  // loop through fields
246
  }
247
  }
248
 
249
+
250
+ /**
251
+ * Returns dropdown/multi-select options keys from a callback function
252
+ * @since 2019-05-30
253
+ */
254
+ $has_custom_source = apply_filters( "um_has_dropdown_options_source__{$key}", false );
255
+ if ( isset( $array['options'] ) && in_array( $array['type'], array( 'select', 'multiselect' ) ) ) {
256
+
257
+ $options = array();
258
+ if ( ! empty( $array['custom_dropdown_options_source'] ) && function_exists( $array['custom_dropdown_options_source'] ) && ! $has_custom_source ) {
259
+ $callback_result = call_user_func( $array['custom_dropdown_options_source'], $array['options'] );
260
+ if ( is_array( $callback_result ) ) {
261
+ $options = array_keys( $callback_result );
262
+ }
263
+ }
264
+
265
+ $array['options'] = apply_filters( "um_custom_dropdown_options__{$key}", $options );
266
+
267
+ }
268
+
269
+
270
  //validation of correct values from options in wp-admin
271
+ $stripslashes = $args['submitted'][ $key ];
272
+ if ( is_string( $stripslashes ) ) {
273
+ $stripslashes = stripslashes( $stripslashes );
274
+ }
275
  if ( in_array( $array['type'], array( 'select' ) ) &&
276
+ ! empty( $array['options'] ) && ! empty( $stripslashes ) &&
277
+ ! in_array( $stripslashes, array_map( 'trim', $array['options'] ) ) && ! $has_custom_source ) {
278
  continue;
279
  }
280
 
281
  //validation of correct values from options in wp-admin
282
  //the user cannot set invalid value in the hidden input at the page
283
  if ( in_array( $array['type'], array( 'multiselect', 'checkbox', 'radio' ) ) &&
284
+ ! empty( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) {
285
  $args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) );
286
  $args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) );
287
  }
320
  }
321
  }
322
 
323
+
324
  if ( isset( $args['submitted']['description'] ) ) {
325
  $to_update['description'] = $args['submitted']['description'];
326
  }
553
  $user_id = um_user( 'ID' );
554
 
555
  $url = um_user_profile_url();
556
+ $avatar = um_get_user_avatar_url( $user_id, 'original' );
557
 
558
  um_reset_user(); ?>
559
 
593
  ?>
594
 
595
  <div class="um-cover <?php if ( um_user( 'cover_photo' ) || ( $default_cover && $default_cover['url'] ) ) echo 'has-cover'; ?>"
596
+ data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
597
 
598
  <?php
599
  /**
721
  function um_profile_header( $args ) {
722
  $classes = null;
723
 
724
+ if ( ! $args['cover_enabled'] ) {
725
  $classes .= ' no-cover';
726
  }
727
 
728
  $default_size = str_replace( 'px', '', $args['photosize'] );
729
 
730
+ // Switch on/off the profile photo uploader
731
+ $disable_photo_uploader = empty( $args['use_custom_settings'] ) ? UM()->options()->get( 'disable_profile_photo_upload' ) : $args['disable_photo_upload'];
732
+
733
+ if ( ! empty( $disable_photo_uploader ) ) {
734
+ $args['disable_photo_upload'] = 1;
735
+ $overlay = '';
736
+ } else {
737
+ $overlay = '<span class="um-profile-photo-overlay">
738
  <span class="um-profile-photo-overlay-s">
739
  <ins>
740
  <i class="um-faicon-camera"></i>
741
  </ins>
742
  </span>
743
  </span>';
744
+ } ?>
 
745
 
746
  <div class="um-header<?php echo $classes; ?>">
747
 
772
  <a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"
773
  title="<?php echo um_user( 'display_name' ); ?>"><?php echo $overlay . get_avatar( um_user( 'ID' ), $default_size ); ?></a>
774
 
775
+ <?php if ( empty( $disable_photo_uploader ) && empty( UM()->user()->cannot_edit ) ) {
 
 
776
 
777
  UM()->fields()->add_hidden_field( 'profile_photo' );
778
 
843
 
844
  }
845
 
846
+ } ?>
 
 
847
 
848
  </div>
849
 
850
  <div class="um-profile-meta">
851
 
852
+ <?php
853
+ /**
854
+ * UM hook
855
+ *
856
+ * @type action
857
+ * @title um_before_profile_main_meta
858
+ * @description Insert before profile main meta block
859
+ * @input_vars
860
+ * [{"var":"$args","type":"array","desc":"Form Arguments"}]
861
+ * @change_log
862
+ * ["Since: 2.0.1"]
863
+ * @usage add_action( 'um_before_profile_main_meta', 'function_name', 10, 1 );
864
+ * @example
865
+ * <?php
866
+ * add_action( 'um_before_profile_main_meta', 'my_before_profile_main_meta', 10, 1 );
867
+ * function my_before_profile_main_meta( $args ) {
868
+ * // your code here
869
+ * }
870
+ * ?>
871
+ */
872
+ do_action( 'um_before_profile_main_meta', $args ); ?>
873
 
874
  <div class="um-main-meta">
875
 
973
 
974
  <div class="um-meta-text">
975
  <textarea id="um-meta-bio"
976
+ data-character-limit="<?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?>"
977
+ placeholder="<?php _e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
978
+ name="<?php echo 'description-' . $args['form_id']; ?>"
979
+ id="<?php echo 'description-' . $args['form_id']; ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
980
  <span class="um-meta-bio-character um-right"><span
981
  class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
982
  <?php
1361
  // Move default tab priority
1362
  $default_tab = UM()->options()->get( 'profile_menu_default_tab' );
1363
  $dtab = ( isset( $tabs[ $default_tab ] ) ) ? $tabs[ $default_tab ] : 'main';
1364
+ if ( isset( $tabs[ $default_tab ] ) ) {
1365
  unset( $tabs[ $default_tab ] );
1366
  $dtabs[ $default_tab ] = $dtab;
1367
  $tabs = $dtabs + $tabs;
1368
+ }
1369
 
1370
+ $tabs_in_nav = array_filter( $tabs, function( $item ) {
1371
+ if ( ! empty( $item['hidden'] ) ) {
1372
+ return false;
1373
+ }
1374
+ return true;
1375
+ });
1376
 
1377
+ if ( ! empty( $tabs_in_nav ) ) { ?>
1378
 
1379
+ <div class="um-profile-nav">
 
 
1380
 
1381
+ <?php foreach ( $tabs as $id => $tab ) {
 
 
 
1382
 
1383
+ if ( isset( $tab['hidden'] ) ) {
1384
+ continue;
1385
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1386
 
1387
+ $nav_link = UM()->permalinks()->get_current_url( get_option( 'permalink_structure' ) );
1388
+ $nav_link = remove_query_arg( 'um_action', $nav_link );
1389
+ $nav_link = remove_query_arg( 'subnav', $nav_link );
1390
+ $nav_link = add_query_arg( 'profiletab', $id, $nav_link );
1391
 
1392
+ /**
1393
+ * UM hook
1394
+ *
1395
+ * @type filter
1396
+ * @title um_profile_menu_link_{$id}
1397
+ * @description Change profile menu link by tab $id
1398
+ * @input_vars
1399
+ * [{"var":"$nav_link","type":"string","desc":"Profile Tab Link"}]
1400
+ * @change_log
1401
+ * ["Since: 2.0"]
1402
+ * @usage
1403
+ * <?php add_filter( 'um_profile_menu_link_{$id}', 'function_name', 10, 1 ); ?>
1404
+ * @example
1405
+ * <?php
1406
+ * add_filter( 'um_profile_menu_link_{$id}', 'my_profile_menu_link', 10, 1 );
1407
+ * function my_profile_menu_link( $nav_link ) {
1408
+ * // your code here
1409
+ * return $nav_link;
1410
+ * }
1411
+ * ?>
1412
+ */
1413
+ $nav_link = apply_filters( "um_profile_menu_link_{$id}", $nav_link );
1414
 
1415
+ $profile_nav_class = '';
1416
+ if ( ! UM()->options()->get( 'profile_menu_icons' ) ) {
1417
+ $profile_nav_class .= ' without-icon';
1418
+ }
1419
 
1420
+ if ( $id == $active_tab ) {
1421
+ $profile_nav_class .= ' active';
1422
+ } ?>
1423
 
1424
+ <div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
1425
+ <?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
1426
+ <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1427
+ title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1428
 
1429
+ <i class="<?php echo $tab['icon']; ?>"></i>
 
 
 
1430
 
1431
+ <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1432
+ <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1433
+ <?php } ?>
1434
 
1435
+ <span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo $tab['name']; ?></span>
1436
+ </a>
1437
+ <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1438
+ title="<?php echo esc_attr( $tab['name'] ); ?>">
1439
 
1440
+ <i class="<?php echo $tab['icon']; ?>"></i>
 
 
 
 
1441
 
1442
+ <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1443
+ <span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
1444
+ <?php } ?>
1445
 
1446
+ <span class="title"><?php echo $tab['name']; ?></span>
1447
+ </a>
1448
+ <?php } else { ?>
1449
+ <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1450
+ title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
 
1451
 
1452
+ <i class="<?php echo $tab['icon']; ?>"></i>
 
 
1453
 
1454
+ <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1455
+ <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1456
+ <?php } ?>
1457
+ </a>
1458
+ <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1459
+ title="<?php echo esc_attr( $tab['name'] ); ?>">
1460
 
1461
+ <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
1462
+ <span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
1463
+ <?php } ?>
1464
 
1465
+ <span class="title"><?php echo $tab['name']; ?></span>
1466
+ </a>
1467
+ <?php } ?>
1468
+ </div>
1469
 
1470
+ <?php } ?>
1471
+
1472
+ <div class="um-clear"></div>
1473
+
1474
+ </div>
1475
+
1476
+ <?php }
1477
 
1478
+ foreach ( $tabs as $id => $tab ) {
1479
 
1480
  if ( isset( $tab['subnav'] ) && $active_tab == $id ) {
1481
 
includes/core/um-filters-fields.php CHANGED
@@ -310,7 +310,9 @@ add_filter( 'um_profile_field_filter_hook__image', 'um_profile_field_filter_hook
310
  * @return string
311
  */
312
  function um_profile_field_filter_hook__( $value, $data, $type = '' ) {
313
- if ( !$value ) return '';
 
 
314
 
315
  if ( ( isset( $data['validate'] ) && $data['validate'] != '' && strstr( $data['validate'], 'url' ) ) || ( isset( $data['type'] ) && $data['type'] == 'url' ) ) {
316
  $alt = ( isset( $data['url_text'] ) && !empty( $data['url_text'] ) ) ? $data['url_text'] : $value;
@@ -333,7 +335,7 @@ function um_profile_field_filter_hook__( $value, $data, $type = '' ) {
333
  if ( $data['validate'] == 'vk_url' ) $value = 'https://vk.com/' . $value;
334
  }
335
 
336
-
337
  if ( isset( $data['validate'] ) && $data['validate'] == 'skype' ) {
338
 
339
  $value = $value;
@@ -351,20 +353,21 @@ function um_profile_field_filter_hook__( $value, $data, $type = '' ) {
351
  }
352
 
353
  if ( isset( $data['validate'] ) && $data['validate'] == 'skype' ) {
354
-
355
  $value = str_replace('https://','',$value );
356
  $value = str_replace('http://','',$value );
357
-
358
  $data['url_target'] = ( isset( $data['url_target'] ) ) ? $data['url_target'] : '_blank';
359
  $value = '<a href="'. 'skype:'.$value.'?chat'.'" title="'.$value.'" target="'.$data['url_target'].'" ' . $url_rel . '>'.$value.'</a>';
360
 
361
- }
362
-
363
- if ( !is_array( $value ) ) {
364
- if ( is_email( $value ) )
365
  $value = '<a href="mailto:'. $value.'" title="'.$value.'">'.$value.'</a>';
 
366
  } else {
367
- $value = implode(', ', $value);
368
  }
369
 
370
  $value = str_replace('https://https://','https://',$value);
@@ -521,15 +524,16 @@ add_filter('um_profile_field_filter_hook__','um_force_utf8_fields', 9, 3 );
521
  * @uses hook filter: um_is_selected_filter_value
522
  */
523
  function um_is_selected_filter_value( $value ) {
524
- if ( ! UM()->options()->get('um_force_utf8_strings') )
525
  return $value;
 
526
 
527
  $value = um_force_utf8_string( $value );
528
 
529
  return $value;
530
  }
531
- add_filter( 'um_is_selected_filter_value','um_is_selected_filter_value', 1, 9 );
532
- add_filter( 'um_select_dropdown_dynamic_option_value','um_is_selected_filter_value', 1, 10 );
533
 
534
  /**
535
  * Filter select dropdown to use UTF-8 encoding
@@ -539,9 +543,10 @@ add_filter( 'um_select_dropdown_dynamic_option_value','um_is_selected_filter_val
539
  * @return array
540
  * @uses hook filter: um_select_dropdown_dynamic_options
541
  */
542
- function um_select_dropdown_dynamic_options_to_utf8( $options, $data ){
543
- if ( ! UM()->options()->get( 'um_force_utf8_strings' ) )
544
  return $options;
 
545
 
546
  foreach ( $options as $key => $value ) {
547
  $options[ $key ] = um_force_utf8_string( $value );
@@ -549,7 +554,7 @@ function um_select_dropdown_dynamic_options_to_utf8( $options, $data ){
549
 
550
  return $options;
551
  }
552
- add_filter( 'um_select_dropdown_dynamic_options','um_select_dropdown_dynamic_options_to_utf8', 2, 10 );
553
 
554
 
555
  /**
@@ -580,12 +585,8 @@ add_filter( 'um_field_non_utf8_value', 'um_field_non_utf8_value' );
580
  * @uses hook filter: um_select_dropdown_dynamic_options, um_multiselect_options
581
  */
582
  function um_select_dropdown_dynamic_callback_options( $options, $data ) {
583
-
584
- if( isset( $data['custom_dropdown_options_source'] ) && ! empty( $data['custom_dropdown_options_source'] ) ){
585
-
586
- if( function_exists( $data['custom_dropdown_options_source'] ) ){
587
- $options = call_user_func( $data['custom_dropdown_options_source'] );
588
- }
589
  }
590
 
591
  return $options;
@@ -604,7 +605,7 @@ add_filter( 'um_multiselect_options','um_select_dropdown_dynamic_callback_option
604
  */
605
 
606
  function um_option_match_callback_view_field( $value, $data ) {
607
- if( ! empty( $data['custom_dropdown_options_source'] ) ){
608
  return UM()->fields()->get_option_value_from_callback( $value, $data, $data['type'] );
609
  }
610
 
@@ -681,13 +682,13 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
681
  }
682
  }
683
  } elseif ( 'select' == $type || 'radio' == $type ) {
684
- if ( ! empty( $data['options'] ) && ! in_array( $value, $data['options'] ) ) {
685
  $value = '';
686
  }
687
  }
688
- } elseif ( ! empty( $value ) ) {
689
  if ( 'multiselect' == $type || 'checkbox' == $type ) {
690
- if ( ! empty( $data['options'] ) && is_array( $value ) ) {
691
  $value = array_intersect( $value, $data['options'] );
692
  }
693
  }
310
  * @return string
311
  */
312
  function um_profile_field_filter_hook__( $value, $data, $type = '' ) {
313
+ if ( ! $value ) {
314
+ return '';
315
+ }
316
 
317
  if ( ( isset( $data['validate'] ) && $data['validate'] != '' && strstr( $data['validate'], 'url' ) ) || ( isset( $data['type'] ) && $data['type'] == 'url' ) ) {
318
  $alt = ( isset( $data['url_text'] ) && !empty( $data['url_text'] ) ) ? $data['url_text'] : $value;
335
  if ( $data['validate'] == 'vk_url' ) $value = 'https://vk.com/' . $value;
336
  }
337
 
338
+
339
  if ( isset( $data['validate'] ) && $data['validate'] == 'skype' ) {
340
 
341
  $value = $value;
353
  }
354
 
355
  if ( isset( $data['validate'] ) && $data['validate'] == 'skype' ) {
356
+
357
  $value = str_replace('https://','',$value );
358
  $value = str_replace('http://','',$value );
359
+
360
  $data['url_target'] = ( isset( $data['url_target'] ) ) ? $data['url_target'] : '_blank';
361
  $value = '<a href="'. 'skype:'.$value.'?chat'.'" title="'.$value.'" target="'.$data['url_target'].'" ' . $url_rel . '>'.$value.'</a>';
362
 
363
+ }
364
+
365
+ if ( ! is_array( $value ) ) {
366
+ if ( is_email( $value ) ) {
367
  $value = '<a href="mailto:'. $value.'" title="'.$value.'">'.$value.'</a>';
368
+ }
369
  } else {
370
+ $value = implode( ', ', $value );
371
  }
372
 
373
  $value = str_replace('https://https://','https://',$value);
524
  * @uses hook filter: um_is_selected_filter_value
525
  */
526
  function um_is_selected_filter_value( $value ) {
527
+ if ( ! UM()->options()->get( 'um_force_utf8_strings' ) ) {
528
  return $value;
529
+ }
530
 
531
  $value = um_force_utf8_string( $value );
532
 
533
  return $value;
534
  }
535
+ add_filter( 'um_is_selected_filter_value','um_is_selected_filter_value', 9, 1 );
536
+ add_filter( 'um_select_dropdown_dynamic_option_value','um_is_selected_filter_value', 10, 1 );
537
 
538
  /**
539
  * Filter select dropdown to use UTF-8 encoding
543
  * @return array
544
  * @uses hook filter: um_select_dropdown_dynamic_options
545
  */
546
+ function um_select_dropdown_dynamic_options_to_utf8( $options, $data ) {
547
+ if ( ! UM()->options()->get( 'um_force_utf8_strings' ) ) {
548
  return $options;
549
+ }
550
 
551
  foreach ( $options as $key => $value ) {
552
  $options[ $key ] = um_force_utf8_string( $value );
554
 
555
  return $options;
556
  }
557
+ add_filter( 'um_select_dropdown_dynamic_options','um_select_dropdown_dynamic_options_to_utf8', 10, 2 );
558
 
559
 
560
  /**
585
  * @uses hook filter: um_select_dropdown_dynamic_options, um_multiselect_options
586
  */
587
  function um_select_dropdown_dynamic_callback_options( $options, $data ) {
588
+ if ( ! empty( $data['custom_dropdown_options_source'] ) && function_exists( $data['custom_dropdown_options_source'] ) ) {
589
+ $options = call_user_func( $data['custom_dropdown_options_source'] );
 
 
 
 
590
  }
591
 
592
  return $options;
605
  */
606
 
607
  function um_option_match_callback_view_field( $value, $data ) {
608
+ if ( ! empty( $data['custom_dropdown_options_source'] ) ) {
609
  return UM()->fields()->get_option_value_from_callback( $value, $data, $data['type'] );
610
  }
611
 
682
  }
683
  }
684
  } elseif ( 'select' == $type || 'radio' == $type ) {
685
+ if ( ! empty( $data['options'] ) && ! in_array( $value, $data['options'] ) && empty( $data['custom_dropdown_options_source'] ) ) {
686
  $value = '';
687
  }
688
  }
689
+ } elseif ( ! empty( $value ) && is_array( $value ) ) {
690
  if ( 'multiselect' == $type || 'checkbox' == $type ) {
691
+ if ( ! empty( $data['options'] ) && empty( $data['custom_dropdown_options_source']