Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bbatie on "Using add_action on login to set localstorage"

$
0
0

I am using the add_action with wp_login to set a localstorage item on login. Its working fine when I try to login at the wp-admin page but instead of going through with the login it goes to the wp-login.php and is just a blank page. Any ideas on this?

Here is my actual code:

function set_storage_yes()
{
echo '<script type="text/javascript">window.localStorage.setItem(\'loggedIn\', \'true\');              </script>';

}
add_action('wp_login', 'set_storage_yes', 10);

Viewing all articles
Browse latest Browse all 8245

Trending Articles