mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- 2.0.55 hotfix for profile restriction options;
This commit is contained in:
@@ -550,6 +550,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
//exclude from privacy UM default pages (except Members list and User(Profile) page)
|
||||
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
|
||||
|
||||
if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) ||
|
||||
um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) ||
|
||||
um_is_core_post( $post, 'password-reset' ) || ( is_user_logged_in() && um_is_core_post( $post, 'user' ) ) )
|
||||
@@ -600,6 +601,16 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
return false;
|
||||
} else {
|
||||
|
||||
//set default redirect if Profile page is restricted for not-logged in users
|
||||
if ( ! is_user_logged_in() && um_is_core_post( $post, 'user' ) && $restriction['_um_accessible'] == '2' ) {
|
||||
if ( isset( $restriction['_um_access_roles'] ) ) {
|
||||
$restriction = array( '_um_accessible' => '2', '_um_access_roles' => $restriction['_um_access_roles'], '_um_noaccess_action' => '1', '_um_access_redirect' => '1', '_um_access_redirect_url' => get_home_url( get_current_blog_id() ) );
|
||||
} else {
|
||||
$restriction = array( '_um_accessible' => '2', '_um_noaccess_action' => '1', '_um_access_redirect' => '1', '_um_access_redirect_url' => get_home_url( get_current_blog_id() ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $restriction;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user