Skip to content

Instantly share code, notes, and snippets.

@nathanrice
Forked from mattonomics/prying-eyes.php
Last active December 12, 2015 12:39
Show Gist options
  • Save nathanrice/4774055 to your computer and use it in GitHub Desktop.
Save nathanrice/4774055 to your computer and use it in GitHub Desktop.
<?php
//** Redirect if not logged in
if ( ! is_user_logged_in() && 'wp-login.php' !== $pagenow ) {
wp_redirect( wp_login_url() );
exit;
}
@nathanrice
Copy link
Author

Yoda conditional, and use wp_login_url().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment