From 30451535fa5bd768c69c06306640dfeb311c4d21 Mon Sep 17 00:00:00 2001 From: Tungnx Date: Mon, 18 Mar 2024 11:39:58 +0700 Subject: [PATCH] = 4.2.6.4 = ~ Tweak: profile publish. --- inc/templates/class-lp-template-profile.php | 24 +++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/inc/templates/class-lp-template-profile.php b/inc/templates/class-lp-template-profile.php index 5c9537476..5c9f6ffb9 100644 --- a/inc/templates/class-lp-template-profile.php +++ b/inc/templates/class-lp-template-profile.php @@ -16,7 +16,12 @@ public function header( $user ) { public function sidebar() { $profile = LP_Profile::instance(); - if ( $profile->get_user_current()->is_guest() ) { + if ( $profile->get_user()->is_guest() ) { + return; + } + + if ( $profile->get_user_current()->is_guest() + && 'yes' !== LP_Profile::get_option_publish_profile() ) { return; } @@ -227,7 +232,7 @@ public function dashboard_latest_courses() { public function order_details() { $profile = LP_Profile::instance(); - $order = $profile->get_view_order(); + $order = $profile->get_view_order(); if ( false === $order ) { return; } @@ -262,8 +267,11 @@ public function dashboard_not_logged_in() { return; } - if ( 'yes' === LP_Settings::get_option( 'enable_login_profile' ) - || 'yes' === LP_Settings::get_option( 'enable_register_profile' ) ) { + if ( ! LP_Profile::instance()->get_user()->is_guest() ) { + return; + } + + if ( 'yes' === LP_Settings::get_option( 'enable_login_profile' ) ) { return; } @@ -275,6 +283,10 @@ public function login_form() { return; } + if ( ! LP_Profile::instance()->get_user()->is_guest() ) { + return; + } + if ( 'yes' !== LP_Settings::get_option( 'enable_login_profile', 'no' ) ) { return; } @@ -287,6 +299,10 @@ public function register_form() { return; } + if ( ! LP_Profile::instance()->get_user()->is_guest() ) { + return; + } + if ( 'yes' !== LP_Settings::get_option( 'enable_register_profile' ) || ! get_option( 'users_can_register' ) ) { return; }