Skip to content

Instantly share code, notes, and snippets.

@stickhandle
Forked from nacin/prying-eyes.php
Created February 13, 2013 02:37

Revisions

  1. @nacin nacin revised this gist Feb 12, 2013. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions prying-eyes.php
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    //** Redirect if not logged in
    add_action( 'template_redirect', function() {

    if ( ! is_user_logged_in() && 'wp-login.php' !== $pagenow ) {
    wp_redirect( wp_login_url() );
    exit;
    }
    if ( ! is_user_logged_in() ) {
    wp_redirect( wp_login_url() );
    exit;
    }
    } );
  2. @nacin nacin revised this gist Feb 12, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions prying-eyes.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    <?php

    //** Redirect if not logged in
    add_action( 'template_redirect', function() {

    if ( ! is_user_logged_in() && 'wp-login.php' !== $pagenow ) {
    wp_redirect( wp_login_url() );
    exit;
  3. @nathanrice nathanrice revised this gist Feb 12, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions prying-eyes.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    <?php

    if ( !is_user_logged_in() && $pagenow !== 'wp-login.php' ) {
    wp_redirect( home_url('wp-login.php') );
    //** Redirect if not logged in
    if ( ! is_user_logged_in() && 'wp-login.php' !== $pagenow ) {
    wp_redirect( wp_login_url() );
    exit;
    }
  4. @mattonomics mattonomics created this gist Feb 12, 2013.
    6 changes: 6 additions & 0 deletions prying-eyes.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <?php

    if ( !is_user_logged_in() && $pagenow !== 'wp-login.php' ) {
    wp_redirect( home_url('wp-login.php') );
    exit;
    }