Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Custom action on login and “remember me”

Don’t use wp_login hook. Use wp_signon function instead.

https://developer.wordpress.org/reference/functions/wp_signon/

wp_signon( array $credentials = array(), string|bool $secure_cookie="" )

The credentials is an array that has ‘user_login’, ‘user_password’,
and ‘remember’ indices. If the credentials is not given, then the log
in form will be assumed and used if set.

Related Posts:

  1. Is there a hook that runs after a user logs in?
  2. Is there a hook before the user is authenticated?
  3. Run javascript code after wp_login hook?
  4. How can I do customizations on login, registration and password recovery forms?
  5. after login that will redirect user role into a page
  6. Firing a function AFTER redirect
  7. How to get session token of current user in wp_login hook?
  8. Send along login credentials with comment content
  9. Is it possible to add the_content filter upon login?
  10. Updating user meta data from external link, user not logged in
  11. How to add a new link to the default register form’s footer links?
  12. Does wp_login hook fire on user registration?
  13. Changing login url
  14. is_user_logged_in() doesn’t work after custom login and redirect
  15. Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
  16. How to get WordPress’ hooks/actions run sequence?
  17. Where can I find a list of WordPress hooks?
  18. Is there a save_post hook for custom post types?
  19. Where is the right place to register/enqueue scripts & styles
  20. How to know what functions are hooked to an action/filter?
  21. How to hook update_post_meta and delete_post_meta?
  22. Are there any hooks that alter the 404 logic?
  23. Difference between do_action and add_action
  24. WP Cron Doesn’t Execute When Time Elapses
  25. WooCommerce: change display order of product short description and price [closed]
  26. Why do some hooks not work inside class context?
  27. Difference between after_setup_theme and init action hooks?
  28. get $post in init filter or action?
  29. Use wp init hook to call other hooks?
  30. How many times can I hook into the same action?
  31. How do I implement the WordPress Iris picker into my plugin on the front-end?
  32. How to intercept a 404 error
  33. Move excerpt meta box to above content editor
  34. Action hook for custom tax edit
  35. Trigger custom action when setting button pressed
  36. What is “all” in isset($wp_filter[‘all’])
  37. Whats worth using add_action when we can simply use add_filter?
  38. Is there a limit to hook priority?
  39. Please explain how these hooks work
  40. Add_action to wp_head via functions.php
  41. Hook after image is uploaded and image sizes generated
  42. Hook that fires when admin setting is saved
  43. add_action(‘wp_ajax_[action name]’, myfunction) problem
  44. WordPress auto login after registration not working
  45. What is the difference between update_post_meta and update_postmeta hooks?
  46. Hook ‘wp_enqueue_scripts’ priority has no effect
  47. Hook on trash post
  48. Hook *after* user password change?
  49. Auto-retrieve YouTube Image for Thumbnail?
  50. Which hook if user profile information is updated?
  51. How to remove action hook done in a plugin from functions.php in my theme?
  52. Hooks for trashing, deleting, saving, restoring custom post type
  53. Is there a WordPress core & plugins update action hook?
  54. Hook into WordPress update?
  55. trigger save_post event programmatically
  56. Implementing advanced add_* function wrappers
  57. Adding onload to body
  58. My add_action (wp_footer, ‘method’) is not calling?
  59. Do WordPress Core Filenames Work as Hooks?
  60. What is the earliest possible hook for safely using `is_front_page`?
  61. switch_to_blog(): Load textdomain
  62. How to call a REST endpoint when a post is published?
  63. __NAMESPACE__ with register_activation_hook
  64. Init action hook running late after PayPal’s return url?
  65. Can I hook inside another hook?
  66. Adding function directly vs using hook in function.php
  67. Are hooks called synchronously?
  68. How to check if which hook triggered the call to a function?
  69. How can I send to multiple Contact Form 7 recipients based on form input? [closed]
  70. Hook into wp_head(); in a plugin
  71. Send data to 3rd party api with wp_remote_post on wp_login
  72. is it possible to get the hook name in add_action?
  73. Hook for URL Request
  74. How do I flush the rules after saving settings using the Settings API?
  75. Does anyone have a visual breakdown of core hooks and when they are fired?
  76. How to customize the WP admin default help contents
  77. What is the action hook for save media-form on gallery tab?
  78. What hook is executed just after wp_query has been executed?
  79. Hide gutenberg option blocks
  80. The ‘user_has_cap’ hook seems to take two page loads to trigger
  81. How and where can we request new WordPress hooks to be added?
  82. Detecting post type within init action
  83. Disable block from editor based on post type
  84. WordPress Admin Tooltip hooks
  85. How can I tell if I’m on a login page? [duplicate]
  86. Difference between hooks Plugin_loaded and admin_int?
  87. Wp_update_post: Infinite loop even with remove_action solution, OOP
  88. Hook/notify when any option or setting is added or updated
  89. Is it possible to save/modify a post without calling the “save_post” action hook?
  90. Change the footer text on the login page
  91. Which hooks is this? add_action(‘wp’,
  92. Redirect logged in users if they are on a specific page
  93. Make W3 Total Cache “Empty All Caches” function purge varnish [closed]
  94. Use $query->set multiple times with pre_get_posts?
  95. admin_post hook not called
  96. Check if action hook exists before adding actions to it
  97. How can I hook into the post editor title field in order to change the HTML?
  98. deactivated_plugin hook: get the name of the plugin
  99. Post-Registration, post-meta hook?
  100. Generating robots.txt dynamically
Categories hooks Tags hooks, login
Associate the “add_rewrite_endpoint” and “$_GET”
Does “update_post_meta” check if value is the same before updating?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress