Created
May 20, 2015 20:03
-
-
Save josephhinson/773ffb9ab88cf50c5bd0 to your computer and use it in GitHub Desktop.
Wishlist Member Levels and Login Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php ?> | |
<div class="member-login"> | |
<?php if (is_user_logged_in()): | |
$loggedin = true; | |
$user = wp_get_current_user(); | |
$levels = WLMAPI::GetUserLevels($user->ID); | |
$getlevels = WLMAPI::GetLevels(); | |
endif; ?> | |
<a class="button" href="javascript:void(null);" onclick="jQuery('.dropdown-box').toggle();"> | |
<?php if ($loggedin): ?> | |
My Membership | |
<?php else : ?> | |
Login | |
<?php endif; ?> | |
</a> | |
<div class="dropdown-box<?php if($loggedin) : ?> loggedin<?php endif; ?>" style="display:none;"> | |
<?php if ($loggedin): ?> | |
<div class="courselinks"> | |
<?php foreach ($levels as $level=>$levelname) { | |
$redir_id = $getlevels[$level]['loginredirect']; | |
?> | |
<p><a href="<?php echo get_permalink($redir_id); ?>"><?php echo $levelname; ?></a></p> | |
<?php } // endfor ?> | |
<p><a href="<?php bloginfo('url'); ?>/wp-admin/profile.php">Edit My Profile</a></p> | |
<p><a href="<?php echo wp_logout_url(); ?>">Logout</a></p> | |
</div> | |
<?php else : ?> | |
<?php wp_login_form(); ?> | |
<?php endif; ?> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment