Restrict which users can be switched TO?
-
Hello,
Is there a way I’m missing to restrict which users can be switched to? For example allow switching to users with an author role but not an editor role.
I’m hooking into
switch_to_user
, but at that time the switching has already happened. I can run checks at that point and force the user to logout, but I’d like to prevent the switching in the first place.It would be great to have a hook like
before_switch_to_user( $to_user_id, $from_user_id)
somewhere near// Check authentication
and// Check intent
that would allow me to set my own logic and return a pass/fail.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Restrict which users can be switched TO?’ is closed to new replies.