From 16e272edabd62bf7865f16cbdcf595312223e6de Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Fri, 16 Aug 2019 20:23:45 +0300 Subject: [PATCH] - 2.0.55 hotfix for profile restriction options; --- README.md | 4 ++-- includes/core/class-access.php | 11 +++++++++++ languages/ultimate-member-en_US.po | 4 ++-- readme.txt | 7 ++++++- ultimate-member.php | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index def856b3..7970136b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 2.0.54 | WordPress 4.9 or higher| 2.0.54 | +| 2.0.55 | WordPress 4.9 or higher| 2.0.55 | Features of the plugin include: @@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version Releases ==================== -[Official Release Version: 2.0.54](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.54). +[Official Release Version: 2.0.55](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.55). Changelog ==================== diff --git a/includes/core/class-access.php b/includes/core/class-access.php index b4ebd455..d47046a0 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -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; } } diff --git a/languages/ultimate-member-en_US.po b/languages/ultimate-member-en_US.po index c3415222..941a999d 100644 --- a/languages/ultimate-member-en_US.po +++ b/languages/ultimate-member-en_US.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Ultimate Member\n" -"POT-Creation-Date: 2019-07-22 18:18+0300\n" -"PO-Revision-Date: 2019-07-22 18:18+0300\n" +"POT-Creation-Date: 2019-08-16 20:21+0300\n" +"PO-Revision-Date: 2019-08-16 20:22+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" diff --git a/readme.txt b/readme.txt index 353273f2..1e6f01c7 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: Tags: community, member, membership, user-profile, user-registration Requires at least: 4.9 Tested up to: 5.2 -Stable tag: 2.0.54 +Stable tag: 2.0.55 License: GNU Version 2 or Any Later Version License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -139,6 +139,11 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = 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 = += 2.0.55: August 16, 2019 = + +* Bugfixes: + - Fixed profile privacy for not logged in users, if restriction options set for profile page as visible only for logged in + = 2.0.54: July 22, 2019 = * Enhancements: diff --git a/ultimate-member.php b/ultimate-member.php index be28bb21..75706710 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 2.0.54 +Version: 2.0.55 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member