Created
April 13, 2016 21:04
-
-
Save martijn94/b654136868acb68cd6ad35df3631d1ad to your computer and use it in GitHub Desktop.
Simple function to check if user is logged in
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 | |
//=========================================================================== | |
// Function to check page security | |
//=========================================================================== | |
function check_page_security() { | |
if( !is_user_logged_in() ) { | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment