mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed access for profile page;
This commit is contained in:
@@ -602,15 +602,29 @@ 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' ) {
|
||||
// set default redirect if Profile page is restricted for not-logged in users and showing message instead of redirect
|
||||
// this snippet was added to make the same action for {site_url}/user and {site_url}/user/{user_slug} URLs
|
||||
// by default {site_url}/user is redirected to Homepage in rewrite rules because hasn't found username in query when user is not logged in
|
||||
if ( ! is_user_logged_in() && um_is_core_post( $post, 'user' ) && $restriction['_um_accessible'] == '2' && $restriction['_um_noaccess_action'] == '0' ) {
|
||||
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() ) );
|
||||
$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() ) );
|
||||
$restriction = array(
|
||||
'_um_accessible' => '2',
|
||||
'_um_noaccess_action' => '1',
|
||||
'_um_access_redirect' => '1',
|
||||
'_um_access_redirect_url' => get_home_url( get_current_blog_id() )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$restriction = apply_filters( 'um_post_content_restriction_settings', $restriction, $post );
|
||||
return $restriction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Ultimate Member\n"
|
||||
"POT-Creation-Date: 2019-10-10 17:20+0300\n"
|
||||
"PO-Revision-Date: 2019-10-10 17:20+0300\n"
|
||||
"POT-Creation-Date: 2019-10-10 18:26+0300\n"
|
||||
"PO-Revision-Date: 2019-10-10 18:26+0300\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: en_US\n"
|
||||
|
||||
@@ -161,6 +161,8 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
- Fixed dynamic_profile.php notice
|
||||
- Fixed integration with WP native admin_post and admin_post_nopriv requests
|
||||
- Fixed profile image settings
|
||||
- Fixed profile privacy for not logged in users, if restriction options set for profile page as visible only for logged in and showing message instead of redirect
|
||||
(it makes the same for {site_url}/user and {site_url}/user/{user_slug} )
|
||||
|
||||
= 2.0.56: August 21, 2019 =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user