New answers tagged

2 votes
Accepted

Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)

Does wordpress support "consumer-users" natively? Or I must do it by means of a plugin? They're just users, you don't need to be able to edit pages to be logged in. In fact if you create a ...
user avatar
  • 52.4k
0 votes

Set redirect for need login

Great question. As ScottM mentioned, you want to use wp_redirect() rather than auth_redirect. Then within the (), you'll want to specify your target. It always makes the most sense to me when I can ...
user avatar
  • 183
0 votes

Set redirect for need login

Use wp_redirect() instead of auth_redirect() - make sure to call exit() right after wp_redirect(). Check out the codex for more info on wp_redirect.
user avatar
  • 306
0 votes
Accepted

WordPress login set cookie that survive browser exit (wp_signon function)

Without knowing what Google OAuth plugin you're using (and how it internally signs a user in), the only way is to override the pluggable function wp_set_auth_cookie, setting $remember to always true: ...
user avatar
  • 35.5k
1 vote
Accepted

How do you manage your pages or functions that require logged-in users?

I tend to use template_redirect action to check, if a user has access to certain content, e.g. a page. To me, it is the most logical and straightforward place to handle the checking. As per the docs, ...
user avatar
0 votes

How to shutdown wordpress login temporarily

Wow - lots of great solutions offered....silly me, I just remove the wp-login.php file from the server, and - if as Tom Nowell asks - any currently logged-in users need to be booted out, I change the ...
user avatar
  • 408

Top 50 recent answers are included