‘wp_login’ action hook not working with wp-login.php file

WordPress 4.9.5

I am work on demo to check after login call some action or function, so that i prepare one plugin. Here is the code.

<?php
/*
Plugin Name: Test Login
Plugin URI: http://wordpress.org/plugins/
Description: This is not just a plugin,
Version: 1.0
*/

function your_function() {
echo “123”;
echo “<script>alert(‘login’)</script>”;
}
add_action(‘wp_login’, ‘your_function’);

But it is not working after successful login from this URL : http://localhost/test_wordpress/wp-login.php.
It will redirect to dashboard and alert message was not display.
Please help for that.

Thank you.

Read more here:: ‘wp_login’ action hook not working with wp-login.php file

Leave a Reply

Your email address will not be published. Required fields are marked *