With the following function :
function require_login() {
if ( !is_user_logged_in() ) {
auth_redirect();
}
}
Which action should be used?
add_action('template_redirect', 'require_login');
or
add_action('get_header', 'require_login');
I've always used template_redirect in the past but lately it doesn't seem to always work.