mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Fix profile access and redirection
This commit is contained in:
@@ -349,3 +349,23 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Profile Access
|
||||
***/
|
||||
add_action('um_access_profile','um_access_profile');
|
||||
function um_access_profile( $user_id ){
|
||||
|
||||
if( ! um_is_myprofile() && um_is_core_page('user') && ! current_user_can('edit_users') ){
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
if( ! in_array( um_user('account_status'), array('approved') ) ){
|
||||
um_redirect_home();
|
||||
}
|
||||
|
||||
um_reset_user();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -149,6 +149,8 @@ class UM_Rewrite {
|
||||
|
||||
um_set_requested_user( $user_id );
|
||||
|
||||
do_action('um_access_profile', $user_id );
|
||||
|
||||
} else {
|
||||
|
||||
exit( wp_redirect( um_get_core_page('user') ) );
|
||||
|
||||
Reference in New Issue
Block a user