From 7aed3486f148ea468e4c58d3b8259c253322436b Mon Sep 17 00:00:00 2001 From: yura_nalivaiko Date: Wed, 23 May 2018 09:54:54 +0300 Subject: [PATCH] - fixed fetch user in tabs; --- includes/core/class-profile.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/core/class-profile.php b/includes/core/class-profile.php index c650cbea..a857654a 100644 --- a/includes/core/class-profile.php +++ b/includes/core/class-profile.php @@ -115,14 +115,21 @@ if ( ! class_exists( 'um\core\Profile' ) ) { 'icon' => 'um-faicon-comment' ) ) ); - um_fetch_user(get_current_user_id()); + // disable private tabs if ( ! is_admin() ) { + if( is_user_logged_in() ) { + $user_id = um_user('ID'); + um_fetch_user( get_current_user_id() ); + } foreach ( $tabs as $id => $tab ) { if ( ! $this->can_view_tab( $id ) ) { unset( $tabs[$id] ); } } + if( is_user_logged_in() ) { + um_fetch_user( $user_id ); + } } return $tabs;