Ultimate Member – User Profile & Membership Plugin - Version 2.0.48

Version Description

Download this release

Release Info

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

Code changes from version 2.0.47 to 2.0.48

includes/core/class-rewrite.php CHANGED
@@ -197,9 +197,7 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
197
  * Locate/display a profile
198
  */
199
  function locate_user_profile() {
200
- global $post;
201
-
202
- if ( um_queried_user() && um_is_core_page('user') ) {
203
 
204
  if ( UM()->options()->get( 'permalink_base' ) == 'user_login' ) {
205
 
@@ -214,9 +212,9 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
214
  "fields" => 'ids',
215
  'meta_query' => array(
216
  array(
217
- 'key' => 'um_user_profile_url_slug_'.$permalink_base,
218
- 'value' => strtolower( um_queried_user() ),
219
- 'compare' => '='
220
  )
221
  ),
222
  'number' => 1
@@ -230,19 +228,21 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
230
  }
231
 
232
  // Try nice name
233
- if ( !$user_id ) {
234
  $slug = um_queried_user();
235
- $slug = str_replace('.','-',$slug);
236
  $the_user = get_user_by( 'slug', $slug );
237
  if ( isset( $the_user->ID ) ){
238
  $user_id = $the_user->ID;
239
  }
240
 
241
- if ( ! $user_id )
242
  $user_id = UM()->user()->user_exists_by_email_as_username( um_queried_user() );
 
243
 
244
- if ( ! $user_id )
245
  $user_id = UM()->user()->user_exists_by_email_as_username( $slug );
 
246
 
247
  }
248
 
@@ -250,12 +250,10 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
250
 
251
  if ( UM()->options()->get( 'permalink_base' ) == 'user_id' ) {
252
  $user_id = UM()->user()->user_exists_by_id( um_queried_user() );
253
-
254
  }
255
 
256
- if ( in_array( UM()->options()->get( 'permalink_base' ), array('name','name_dash','name_dot','name_plus') ) ) {
257
  $user_id = UM()->user()->user_exists_by_name( um_queried_user() );
258
-
259
  }
260
 
261
  /** USER EXISTS SET USER AND CONTINUE **/
@@ -291,7 +289,7 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
291
 
292
  }
293
 
294
- } else if ( um_is_core_page( 'user' ) ) {
295
 
296
  if ( is_user_logged_in() ) { // just redirect to their profile
297
 
@@ -330,7 +328,7 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
330
  * ?>
331
  */
332
  $redirect_to = apply_filters( 'um_locate_user_profile_not_loggedin__redirect', home_url() );
333
- if ( ! empty( $redirect_to ) ){
334
  exit( wp_redirect( $redirect_to ) );
335
  }
336
 
197
  * Locate/display a profile
198
  */
199
  function locate_user_profile() {
200
+ if ( um_queried_user() && um_is_core_page( 'user' ) ) {
 
 
201
 
202
  if ( UM()->options()->get( 'permalink_base' ) == 'user_login' ) {
203
 
212
  "fields" => 'ids',
213
  'meta_query' => array(
214
  array(
215
+ 'key' => 'um_user_profile_url_slug_' . $permalink_base,
216
+ 'value' => strtolower( um_queried_user() ),
217
+ 'compare' => '='
218
  )
219
  ),
220
  'number' => 1
228
  }
229
 
230
  // Try nice name
231
+ if ( ! $user_id ) {
232
  $slug = um_queried_user();
233
+ $slug = str_replace( '.', '-', $slug );
234
  $the_user = get_user_by( 'slug', $slug );
235
  if ( isset( $the_user->ID ) ){
236
  $user_id = $the_user->ID;
237
  }
238
 
239
+ if ( ! $user_id ) {
240
  $user_id = UM()->user()->user_exists_by_email_as_username( um_queried_user() );
241
+ }
242
 
243
+ if ( ! $user_id ) {
244
  $user_id = UM()->user()->user_exists_by_email_as_username( $slug );
245
+ }
246
 
247
  }
248
 
250
 
251
  if ( UM()->options()->get( 'permalink_base' ) == 'user_id' ) {
252
  $user_id = UM()->user()->user_exists_by_id( um_queried_user() );
 
253
  }
254
 
255
+ if ( in_array( UM()->options()->get( 'permalink_base' ), array( 'name', 'name_dash', 'name_dot', 'name_plus' ) ) ) {
256
  $user_id = UM()->user()->user_exists_by_name( um_queried_user() );
 
257
  }
258
 
259
  /** USER EXISTS SET USER AND CONTINUE **/
289
 
290
  }
291
 
292
+ } elseif ( um_is_core_page( 'user' ) ) {
293
 
294
  if ( is_user_logged_in() ) { // just redirect to their profile
295
 
328
  * ?>
329
  */
330
  $redirect_to = apply_filters( 'um_locate_user_profile_not_loggedin__redirect', home_url() );
331
+ if ( ! empty( $redirect_to ) ) {
332
  exit( wp_redirect( $redirect_to ) );
333
  }
334
 
includes/core/class-shortcodes.php CHANGED
@@ -635,7 +635,10 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
635
  */
636
  $args = apply_filters( 'um_shortcode_args_filter', $args );
637
 
638
- extract($args, EXTR_SKIP);
 
 
 
639
 
640
  //not display on admin preview
641
  if ( empty( $_POST['act_id'] ) || $_POST['act_id'] != 'um_admin_preview_form' ) {
@@ -647,6 +650,12 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
647
 
648
  // for profiles only
649
  if ( $mode == 'profile' && um_profile_id() ) {
 
 
 
 
 
 
650
  if ( ! empty( $args['use_custom_settings'] ) ) { // Custom Form settings
651
  $current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
652
 
635
  */
636
  $args = apply_filters( 'um_shortcode_args_filter', $args );
637
 
638
+ /**
639
+ * @var string $mode
640
+ */
641
+ extract( $args, EXTR_SKIP );
642
 
643
  //not display on admin preview
644
  if ( empty( $_POST['act_id'] ) || $_POST['act_id'] != 'um_admin_preview_form' ) {
650
 
651
  // for profiles only
652
  if ( $mode == 'profile' && um_profile_id() ) {
653
+
654
+ //set requested user if it's not setup from permalinks (for not profile page in edit mode)
655
+ if ( ! um_get_requested_user() ) {
656
+ um_set_requested_user( um_profile_id() );
657
+ }
658
+
659
  if ( ! empty( $args['use_custom_settings'] ) ) { // Custom Form settings
660
  $current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
661
 
includes/core/class-user.php CHANGED
@@ -836,11 +836,11 @@ if ( ! class_exists( 'um\core\User' ) ) {
836
  }
837
 
838
  // add user meta
839
- foreach( $this->usermeta as $k=>$v ) {
840
  if ( $k == 'display_name') {
841
  continue;
842
  }
843
- $this->profile[$k] = $v[0];
844
  }
845
 
846
  // add permissions
836
  }
837
 
838
  // add user meta
839
+ foreach ( $this->usermeta as $k => $v ) {
840
  if ( $k == 'display_name') {
841
  continue;
842
  }
843
+ $this->profile[ $k ] = $v[0];
844
  }
845
 
846
  // add permissions
includes/core/um-actions-profile.php CHANGED
@@ -567,7 +567,7 @@ function um_profile_header_cover_area( $args ) {
567
 
568
  ?>
569
 
570
- <div class="um-cover <?php if ( um_profile( '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
@@ -593,9 +593,9 @@ function um_profile_header_cover_area( $args ) {
593
  do_action( 'um_cover_area_content', um_profile_id() );
594
  if ( UM()->fields()->editing ) {
595
 
596
- $hide_remove = um_profile( 'cover_photo' ) ? false : ' style="display:none;"';
597
 
598
- $text = ! um_profile( 'cover_photo' ) ? __( 'Upload a cover photo', 'ultimate-member' ) : __( 'Change cover photo', 'ultimate-member' ) ;
599
 
600
  $items = array(
601
  '<a href="javascript:void(0);" class="um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width">' . $text . '</a>',
@@ -603,16 +603,20 @@ function um_profile_header_cover_area( $args ) {
603
  '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
604
  );
605
 
 
 
606
  UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items );
607
  } else {
608
 
609
- if ( ! isset( UM()->user()->cannot_edit ) && ! um_profile( 'cover_photo' ) ) {
610
 
611
  $items = array(
612
  '<a href="javascript:void(0);" class="um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width">' . __( 'Upload a cover photo', 'ultimate-member' ) . '</a>',
613
  '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
614
  );
615
 
 
 
616
  UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items );
617
 
618
  }
@@ -623,7 +627,7 @@ function um_profile_header_cover_area( $args ) {
623
 
624
  <div class="um-cover-e" data-ratio="<?php echo $args['cover_ratio']; ?>">
625
 
626
- <?php if ( um_profile( 'cover_photo' ) ) {
627
 
628
  if ( UM()->mobile()->isMobile() ) {
629
  if ( UM()->mobile()->isTablet() ) {
567
 
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
593
  do_action( 'um_cover_area_content', um_profile_id() );
594
  if ( UM()->fields()->editing ) {
595
 
596
+ $hide_remove = um_user( 'cover_photo' ) ? false : ' style="display:none;"';
597
 
598
+ $text = ! um_user( 'cover_photo' ) ? __( 'Upload a cover photo', 'ultimate-member' ) : __( 'Change cover photo', 'ultimate-member' ) ;
599
 
600
  $items = array(
601
  '<a href="javascript:void(0);" class="um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width">' . $text . '</a>',
603
  '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
604
  );
605
 
606
+ $items = apply_filters( 'um_cover_area_content_dropdown_items', $items, um_profile_id() );
607
+
608
  UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items );
609
  } else {
610
 
611
+ if ( ! isset( UM()->user()->cannot_edit ) && ! um_user( 'cover_photo' ) ) {
612
 
613
  $items = array(
614
  '<a href="javascript:void(0);" class="um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width">' . __( 'Upload a cover photo', 'ultimate-member' ) . '</a>',
615
  '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
616
  );
617
 
618
+ $items = apply_filters( 'um_cover_area_content_dropdown_items', $items, um_profile_id() );
619
+
620
  UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items );
621
 
622
  }
627
 
628
  <div class="um-cover-e" data-ratio="<?php echo $args['cover_ratio']; ?>">
629
 
630
+ <?php if ( um_user( 'cover_photo' ) ) {
631
 
632
  if ( UM()->mobile()->isMobile() ) {
633
  if ( UM()->mobile()->isTablet() ) {
includes/um-short-functions.php CHANGED
@@ -1697,10 +1697,9 @@ function um_fetch_user( $user_id ) {
1697
  *
1698
  * @param $key
1699
  *
1700
- * @return mixed|void
1701
  */
1702
  function um_profile( $key ) {
1703
-
1704
  if ( ! empty( UM()->user()->profile[ $key ] ) ) {
1705
  /**
1706
  * UM hook
1697
  *
1698
  * @param $key
1699
  *
1700
+ * @return bool|string
1701
  */
1702
  function um_profile( $key ) {
 
1703
  if ( ! empty( UM()->user()->profile[ $key ] ) ) {
1704
  /**
1705
  * UM hook
languages/ultimate-member-en_US.mo CHANGED
Binary file
languages/ultimate-member-en_US.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ultimate Member\n"
4
- "POT-Creation-Date: 2019-05-14 10:09+0300\n"
5
- "PO-Revision-Date: 2019-05-14 10:09+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: en_US\n"
@@ -3616,11 +3616,11 @@ msgstr ""
3616
  #: includes/admin/templates/role/publish.php:24
3617
  #: includes/core/class-fields.php:2336 includes/core/class-fields.php:2433
3618
  #: includes/core/um-actions-profile.php:603
3619
- #: includes/core/um-actions-profile.php:613
3620
- #: includes/core/um-actions-profile.php:750
3621
- #: includes/core/um-actions-profile.php:783
3622
- #: includes/core/um-actions-profile.php:1128
3623
- #: includes/core/um-actions-profile.php:1135
3624
  msgid "Cancel"
3625
  msgstr ""
3626
 
@@ -3983,7 +3983,7 @@ msgid "Members"
3983
  msgstr ""
3984
 
3985
  #: includes/class-config.php:133 includes/class-config.php:745
3986
- #: includes/core/um-actions-profile.php:1134
3987
  #: includes/core/um-actions-user.php:15
3988
  msgid "Logout"
3989
  msgstr ""
@@ -6370,7 +6370,7 @@ msgid "Upload Photo"
6370
  msgstr ""
6371
 
6372
  #: includes/core/class-fields.php:2311 includes/core/class-fields.php:2335
6373
- #: includes/core/um-actions-profile.php:781
6374
  msgid "Change photo"
6375
  msgstr ""
6376
 
@@ -6523,11 +6523,11 @@ msgid ""
6523
  "\"{login_referrer}\">login</a> to view this content."
6524
  msgstr ""
6525
 
6526
- #: includes/core/class-shortcodes.php:644
6527
  msgid "You are already registered"
6528
  msgstr ""
6529
 
6530
- #: includes/core/class-shortcodes.php:885
6531
  msgid "Default Template"
6532
  msgstr ""
6533
 
@@ -6956,8 +6956,8 @@ msgid "Your choosed %s"
6956
  msgstr ""
6957
 
6958
  #: includes/core/um-actions-profile.php:598
6959
- #: includes/core/um-actions-profile.php:612
6960
- #: includes/core/um-actions-profile.php:650
6961
  msgid "Upload a cover photo"
6962
  msgstr ""
6963
 
@@ -6965,29 +6965,29 @@ msgstr ""
6965
  msgid "Change cover photo"
6966
  msgstr ""
6967
 
6968
- #: includes/core/um-actions-profile.php:749
6969
  msgid "Upload photo"
6970
  msgstr ""
6971
 
6972
- #: includes/core/um-actions-profile.php:782
6973
  msgid "Remove photo"
6974
  msgstr ""
6975
 
6976
- #: includes/core/um-actions-profile.php:946
6977
  msgid "Tell us a bit about yourself..."
6978
  msgstr ""
6979
 
6980
- #: includes/core/um-actions-profile.php:962
6981
  #, php-format
6982
  msgid "This user account status is %s"
6983
  msgstr ""
6984
 
6985
- #: includes/core/um-actions-profile.php:1101
6986
- #: includes/core/um-actions-profile.php:1132
6987
  msgid "Edit Profile"
6988
  msgstr ""
6989
 
6990
- #: includes/core/um-actions-profile.php:1133
6991
  msgid "My Account"
6992
  msgstr ""
6993
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ultimate Member\n"
4
+ "POT-Creation-Date: 2019-05-16 19:17+0300\n"
5
+ "PO-Revision-Date: 2019-05-16 19:17+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: en_US\n"
3616
  #: includes/admin/templates/role/publish.php:24
3617
  #: includes/core/class-fields.php:2336 includes/core/class-fields.php:2433
3618
  #: includes/core/um-actions-profile.php:603
3619
+ #: includes/core/um-actions-profile.php:615
3620
+ #: includes/core/um-actions-profile.php:754
3621
+ #: includes/core/um-actions-profile.php:787
3622
+ #: includes/core/um-actions-profile.php:1132
3623
+ #: includes/core/um-actions-profile.php:1139
3624
  msgid "Cancel"
3625
  msgstr ""
3626
 
3983
  msgstr ""
3984
 
3985
  #: includes/class-config.php:133 includes/class-config.php:745
3986
+ #: includes/core/um-actions-profile.php:1138
3987
  #: includes/core/um-actions-user.php:15
3988
  msgid "Logout"
3989
  msgstr ""
6370
  msgstr ""
6371
 
6372
  #: includes/core/class-fields.php:2311 includes/core/class-fields.php:2335
6373
+ #: includes/core/um-actions-profile.php:785
6374
  msgid "Change photo"
6375
  msgstr ""
6376
 
6523
  "\"{login_referrer}\">login</a> to view this content."
6524
  msgstr ""
6525
 
6526
+ #: includes/core/class-shortcodes.php:647
6527
  msgid "You are already registered"
6528
  msgstr ""
6529
 
6530
+ #: includes/core/class-shortcodes.php:894
6531
  msgid "Default Template"
6532
  msgstr ""
6533
 
6956
  msgstr ""
6957
 
6958
  #: includes/core/um-actions-profile.php:598
6959
+ #: includes/core/um-actions-profile.php:614
6960
+ #: includes/core/um-actions-profile.php:654
6961
  msgid "Upload a cover photo"
6962
  msgstr ""
6963
 
6965
  msgid "Change cover photo"
6966
  msgstr ""
6967
 
6968
+ #: includes/core/um-actions-profile.php:753
6969
  msgid "Upload photo"
6970
  msgstr ""
6971
 
6972
+ #: includes/core/um-actions-profile.php:786
6973
  msgid "Remove photo"
6974
  msgstr ""
6975
 
6976
+ #: includes/core/um-actions-profile.php:950
6977
  msgid "Tell us a bit about yourself..."
6978
  msgstr ""
6979
 
6980
+ #: includes/core/um-actions-profile.php:966
6981
  #, php-format
6982
  msgid "This user account status is %s"
6983
  msgstr ""
6984
 
6985
+ #: includes/core/um-actions-profile.php:1105
6986
+ #: includes/core/um-actions-profile.php:1136
6987
  msgid "Edit Profile"
6988
  msgstr ""
6989
 
6990
+ #: includes/core/um-actions-profile.php:1137
6991
  msgid "My Account"
6992
  msgstr ""
6993
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires at least: 4.9
8
  Tested up to: 5.2
9
- Stable tag: 2.0.47
10
  License: GNU Version 2 or Any Later Version
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
 
@@ -133,6 +133,14 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
133
 
134
  = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
135
 
 
 
 
 
 
 
 
 
136
  = 2.0.47: May 14, 2019 =
137
 
138
  * Bugfixes:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires at least: 4.9
8
  Tested up to: 5.2
9
+ Stable tag: 2.0.48
10
  License: GNU Version 2 or Any Later Version
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
 
133
 
134
  = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
135
 
136
+ = 2.0.48: May 16, 2019 =
137
+
138
+ * Enhancements:
139
+ - Added an ability to 3rd party integration with cover image actions
140
+
141
+ * Bugfixes:
142
+ - Fixed ability to edit profile on not predefined Profile Page
143
+
144
  = 2.0.47: May 14, 2019 =
145
 
146
  * 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.0.47
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.0.48
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member