wp_login is fired in wp_signon after the user has successfully logged in.
That’s after submitting the login form, so obviously you can’t execute any JavaScript there. Of course you can still do something in PHP.
If you want to execute JavaScript after login, you need to find another hook.
Related Posts:
- When can you get current page ID and initialize hooks right after?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Is it possible to add an action to the currently running action?
- How to prevent action in ajax request, when in admin side?
- template_redirect not being called when using ajax
- What are the benefit in adding hook in the init() hook?
- add_action in functions.php, do_action in plugin?
- add action for displaying posts using a shortcode
- Any hook for pre-plugin-update -either bulk or single plugin update
- How to get all of the activate_plugin action parameters?
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Hook for page Request?
- I cannot include a file in my plugin settings page
- The function called on the wp head hook becomes null
- Passing function into add_action always returns the first argument
- Plugin Hook: Get posts
- How wordpress plugin hooks works? [duplicate]
- Remove rewrite rules generated by plugin during deactivation
- How to pull code snippet from functionality plugin?
- Where (or when) should I register a new taxonomy?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- WordPress filter that hook after each action/filter hook
- wordpress plugin is not activating from widget
- All Users > User List > Update User Meta Field Inline
- Insert new user with form submit ‘init’ hook
- When to load auto-login code?
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Calling plugin function inside custom plugin for onclick event
- How to check current user before all actions and filters?
- Custom plugin init action causing general slowness
- Create tabs in admin options page from custom post type loop
- do_action() hook into load-(page)
- Howto check version of another plugin and then add a submenu page to it
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How to get post ID with hooks publish_post, new_to_publish, etc
- edit_user_profile and show_user_profile are not firing inside a class
- Add action to fire when a published post is updated
- How to pass variables to a function argument using add_action [duplicate]
- Add sub menu page in your plugin
- Submit Form data to another page via Ajax (WordPress Way)
- How to make multiple admin pages for one plugin?
- the_post hook is not firing for me
- Why do plugins often ask to add in to templates?
- Does using `add_action( ‘init’…` cause performance issues?
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- Plugin Development – Functions or Hooks?
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Display Plugin Panels Outside of Admin Areas
- Are there action hooks for comments?
- How do I add $_SESSION[”] to my wordpress page?
- WooCommerce: after install hook
- Save user total active time after login in wordpress [closed]
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove a class function from a plugin by using remove_action()?
- Advanced WordPress plugin activation detection
- wp_loaded with static Singleton
- How to remove a CPT Menu from the Root Admin only
- is it possible to hook every page style?
- Is there a better way of handling AJAX requests in WordPress?
- Add action to custom Function
- Custom CSS not being added by plugin
- How to use add_action for multiple instances of the same class
- What hook can I use to modify custom post data before it is displayed on the page?
- How to hook into action/filter call
- Quick press publish post hook
- using wp_footer hook in a plugin
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- How to deactivate my plugin upon deactivation of NextGen
- How to automatically activate users after registration without activation email?
- Creating a plugin that will display text on every page
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Activation flow of a plugin in a multisite environment
- Hook from plugin doesn’t fire up from external PHP script
- Add hook after content without formatting
- force logged in user to stay in the dashboard
- admin_post hook not firing function inside class
- update_option_{$option} not working (do function after options are saved)
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Callback hooked to post_updated firing on new posts as well
- Why do actions with class and public method don’t fire __construct()
- How to properly enqueue jQuery knob on WordPress without conflict?
- Hooking into the HTML header container
- When/where would want to attach other classes to the base class in a WordPress plugin?
- Nested Actions and Filters
- Use action, filter, or hook to append HTML to WordPress plugin function
- Get post content inside plugin class method
- Hook to display element as product on category page
- Admin menu hilighting wrong item for CPT
- Is admin section completely customizable in terms of styling?
- Store admin page into variable
- Remove action added in plugin class from theme
- {status}_{post_type} does not run correctly?
- wordpress plugin translation not working