[ create a new paste ] login | about

Link: http://codepad.org/91IkZBlW    [ raw code | output | fork ]

PHP, pasted on Oct 18:
1
2
3
4
5
6
7
8
9
10
/**
 * Checks if a user is logged in, if not redirect them to the login page.
 */
function appthemes_auth_redirect_login() {
	if ( !is_user_logged_in() ) {
		nocache_headers();
		wp_redirect( wp_login_url( scbUtil::get_current_url() ) );
		exit();
	}
}


Output:
1
2
3
4
5
6
7
8
9
10
/**
 * Checks if a user is logged in, if not redirect them to the login page.
 */
function appthemes_auth_redirect_login() {
	if ( !is_user_logged_in() ) {
		nocache_headers();
		wp_redirect( wp_login_url( scbUtil::get_current_url() ) );
		exit();
	}
}


Create a new paste based on this one


Comments: