1

This question already has an answer here:

Does anyone know the add_action() hook to use immediately after a user is successfully authenticated.

Hook Test based on @mmm's answer

I ran this test from my mu-plugins.php file:

function check_for_superAdmin() {
    if ( is_super_admin() ) { echo 'I\'m a Super Admin !'; exit; }
}
add_action( 'wp_login', 'check_for_superAdmin' );

the check_for_superAdmin() function works but the is_super_admin() function does not. I may need to pass a parameter in there. Checking....

marked as duplicate by Howdy_McGee, TheDeadMedic, Sisir, Mayeenul Islam, Robert hue Sep 2 '15 at 5:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

juste before testing login and password, you have the action wp_authenticate: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate

juste after test and only if logging is successful, the action wp_login: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login

and after logging, you can also modify the URL with the filter login_redirect: https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

  • It did not work @mmm – tammy Aug 5 '15 at 21:07
  • maybe is it waiting for the working contract ? – mmm Aug 5 '15 at 21:11
  • Sorry @mmm, it actually does work. it is my is_super_admin() function that did not work. – tammy Aug 5 '15 at 21:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.