Created
January 12, 2015 18:12
-
-
Save dancameron/174631fedc27a61e07d1 to your computer and use it in GitHub Desktop.
Redirect Away if not 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 si_redirect_if_not_logged_in() { | |
if ( !is_user_logged_in() ) { | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
} | |
add_action( 'pre_si_invoice_view', 'si_redirect_if_not_logged_in' ); | |
add_action( 'pre_si_estimate_view', 'si_redirect_if_not_logged_in' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment