Successful log-ins trigger the action wp_login
, failures wp_login_failed
. Phone calls are not built-in, you need a separate plugin for that.
Example with email:
add_action( 'wp_login_failed', 'wpse_79917_login_failed' );
add_action( 'wp_login', 'wpse_79917_login_success', 10, 2 );
function wpse_79917_login_failed( $username )
{
wp_mail(
get_option( 'admin_email'),
'Login failed',
'custom message'
);
}
function wpse_79917_login_success( $user_login, $user )
{
wp_mail(
get_option( 'admin_email'),
'Login successful',
'custom message'
);
}