If you look at the code for wp-login.php
both the login
case and the default case run wp_signon()
. The reason, so it seems to me, is to manage cases where a user already has a valid cookie for the site. So I don’t think there is a hook that fires only upon login, but it is pretty easy to compensate. The first hook along that login path and before authentication is the action hook wp_authenticate
not authenticate
(though that is a valid hook).
function customcode($username, $password ) {
if (!empty($username) && !empty($password)) {
// your code
}
}
add_action('wp_authenticate', 'customcode', 30, 2);
Related Posts:
- Is there a hook that runs after a user logs in?
- Run javascript code after wp_login hook?
- How can I do customizations on login, registration and password recovery forms?
- after login that will redirect user role into a page
- Firing a function AFTER redirect
- How to get session token of current user in wp_login hook?
- Custom action on login and “remember me”
- Send along login credentials with comment content
- Is it possible to add the_content filter upon login?
- Updating user meta data from external link, user not logged in
- How to add a new link to the default register form’s footer links?
- Does wp_login hook fire on user registration?
- Changing login url
- Where can I find a list of WordPress hooks?
- How to intercept a 404 error
- Move excerpt meta box to above content editor
- Whats worth using add_action when we can simply use add_filter?
- Which hook if user profile information is updated?
- Are hooks called synchronously?
- Detecting post type within init action
- Disable block from editor based on post type
- Difference between hooks Plugin_loaded and admin_int?
- Change the footer text on the login page
- Make W3 Total Cache “Empty All Caches” function purge varnish [closed]
- Which hook should be used to validate custom form fields on the login form?
- How to inject content after
- How to debug removal of rewrite rule flushing?
- function ‘wp_enable_block_templates’ not found
- Why does wp_enqueue_script ignore my ‘wp_head’ hook?
- How can I add a default description to uploaded files?
- Hook Widget to Woo Theme in functions.php
- Security around save_post hook
- How to pass arguments to add_action() [duplicate]
- action lifecycle
- How to use the post_updated hook before and after arguments
- Customize user account activation message
- How get list all users who edited post?
- Stuck in redirect loop after using wp_login action
- I don’t understand why I shoud use lostpassword_url hook?
- How to update WordPress core or themes and still have my child theme hooks work
- Hook any php file into the wordpress api
- WP CLI Get all Enqueued Scripts and Styles
- Change username before login
- Delay an action until current action is completed
- How to properly setup an activation hook
- How to remove scripts/style added to customize_controls_enqueue_scripts hook by current active theme
- Help to change the text for new website notification (wpmu_welcome_notification)
- How to remove query string from current page URL?
- How can I count post views of REST API calls and update them in an ACF field?
- Plugins rewrite rules the right way
- new_to_publish fires multiple times
- Strange behaviour with add_{$meta_type}_metadata | add_post_metadata filter
- How can I get my Script to work on the Login page?
- Add nofollow to custom widget posts
- Change Password Confirmed Email Text
- get_post_metadata causing some meta data to fail
- Register form: add custom field BEFORE default fields
- Custom Front End Registration – How Does the Key work in the Password Set Request?
- How to modify how the_content outputs a link to an internal page
- Lock user information once fields have been filled in
- save_post hook to add terms getting deleted when using bulk edit
- Add Different Actions To Different Page’s wp_footer
- ‘save_post’ hook not working in WP 3.5
- Getting the post ID in parse_query
- Remove genesis_404 hook from genesis_loop [closed]
- What hooks do I need to hook into to capture ever wp_user creation/change?
- Modifying the wordpress login page and then referencing it with a shortcode problem
- Neccessary to call add_submenu_page and add_menu_page from admin_menu hook?
- Adding custom Bulk Actions
- How to hook in to the “output buffer” and add html content
- hook for loading page
- How to call do_action() to pass arguments to hooked functions that take different number of args?
- Is it likely that do_action will have unexpected results?
- How to export category name and category link in wordpress json
- Error later wordpress 5.3.2 update. Please help
- How to abort a save operation with a WordPress hook?
- is_page not triggering
- admin_post_(action) hook create console log error
- Check if front page within function passed to action
- how to do display: block after user login
- Hook after creating a post and retrieve infos from this post immediatly
- Check get_post value after wp-admin login
- calculate values from a field and insert them into custom fields when publishing or updating post
- $new_pass always returns null – password_reset hook
- How to resolve 500 error in post listing page?
- Object oriented programming, add_action in constructor not firing
- Get new (not old) post inside transition_post_status hook
- How to Show Different Information to your authors/contributers
- Cannot override hooks.php
- Removing action from template class
- Remove “enqueued” script from array
- Function is Missing an Action Hook
- How to access variables in the function where apply_filters() is called?
- PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered
- How can I add new attributes in a Class when my addon is active?
- getSaveContent.extraProps hook for core/post-title doesn’t add new attributes on to the frontend
- Creating my own “recent blog posts” static Gutenberg block, can’t use react hooks in the frontend
- How do I set a custom post type Category after import using wp_set_post_terms
- How can I get the ID before after_setup_theme?
- Hook on opening a media/document