Skip to content

Commit 133c214

Browse files
authored
Merge pull request #875 from wpdev10/master
redirect profile page to login page if user is not logged in.
2 parents 8edac67 + ea913af commit 133c214

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

assets/js/users-wp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ function uwp_modal_login_form_process(){
447447
}
448448

449449
}else if(data.success===false){
450-
jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
450+
jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data);
451451
jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').html($button_text).prop('disabled', false);// enable submit
452452
uwp_maybe_reset_recaptcha();
453453
}

assets/js/users-wp.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/class-templates.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ public function profile_redirect() {
328328
wp_safe_redirect( $profile_url );
329329
exit();
330330
} else {
331-
$redirect_to = apply_filters( 'uwp_no_login_profile_redirect', home_url( '/' ) );
331+
$redirect_to = apply_filters( 'uwp_no_login_profile_redirect', uwp_get_page_link('login') );
332+
$redirect_to = add_query_arg('redirect_to', urlencode(get_permalink($profile_page)), $redirect_to);
332333
wp_safe_redirect( $redirect_to );
333334
exit();
334335
}

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Yes, you can customize it with Elementor, but also with Gutenberg, Divi, Beaver
155155
= 1.2.54 - 2026-01-TBD =
156156
* Max entries per csv file option in Import/Export setting not showing options - FIXED
157157
* Check nonce while profile image and cover image crop - FIXED/SECURITY
158+
* Redirect profile page to login instead of home page if accessed without login - FIXED
158159

159160
= 1.2.53 - 2026-01-08 =
160161
* Prevent duplicate event handlers in registration form switcher causing multiple AJAX requests - FIXED

0 commit comments

Comments
 (0)