Skip to content

Commit

Permalink
= 4.2.6.4 =
Browse files Browse the repository at this point in the history
~ Tweak: profile publish.
  • Loading branch information
tungnxt89 committed Mar 18, 2024
1 parent 161171d commit 3045153
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions inc/templates/class-lp-template-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 3045153

Please sign in to comment.