Skip to content

Instantly share code, notes, and snippets.

@martijn94
Created April 13, 2016 21:04
Show Gist options
  • Save martijn94/b654136868acb68cd6ad35df3631d1ad to your computer and use it in GitHub Desktop.
Save martijn94/b654136868acb68cd6ad35df3631d1ad to your computer and use it in GitHub Desktop.
Simple function to check if user is logged in
<?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