Skip to content

Instantly share code, notes, and snippets.

@jeffsebring
Created November 14, 2013 19:46
Show Gist options
  • Select an option

  • Save jeffsebring/7473138 to your computer and use it in GitHub Desktop.

Select an option

Save jeffsebring/7473138 to your computer and use it in GitHub Desktop.

Revisions

  1. jeffsebring created this gist Nov 14, 2013.
    14 changes: 14 additions & 0 deletions pu01_logged_in_redirect.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    <?php
    /**
    * Logged in Home Page Redirect
    **/

    add_action( 'template_redirect', 'pu01_logged_in_homepage' );

    // Redirect logged in users from home page to admin
    function pu01_logged_in_homepage() {

    if ( is_user_logged_in() && is_home() )
    wp_redirect( admin_url(), 307 );

    }