Created
June 25, 2019 13:35
-
-
Save someguy9/9b8d93f59adae835ce8f0b2c6b1e8ee4 to your computer and use it in GitHub Desktop.
Simple code using the built in WP function that checks if you a user is logged into WordPress.
This file contains hidden or 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 | |
if ( is_user_logged_in() ) { | |
echo 'Welcome, logged in user. <a href="'.wp_logout_url().'">Click here to logout</a>.'; | |
}else{ | |
echo 'Please login by <a href="'.wp_login_url().'">clicking here</a>.' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment