Use the password_reset
hook.
function wpse_password_reset( $user, $new_pass ) {
//* Do something useful with $new_pass
}
add_action( 'password_reset', 'wpse_password_reset', 10, 2 );
Edited to add after the comment:
Looks like the reason I can’t use that is that the plugin uses wp_update_user to set the new password. Is there any way I can intercept the password prior to this?
Yes. You can use the send_password_change_email
filter.
function wpse_send_password_change_email( $true, $user, $userdata ) {
//* Do something useful with the new password
wp_die(
sprintf(
'%1$s changed their password to %2$s.',
$userdata[ 'user_login' ],
$_POST[ 'pass1' ]
)
);
//* Need to return $true since it's a filter
return $true;
}
add_filter( 'send_password_change_email', 'wpse_send_password_change_email', 10, 3 );
Related Posts:
- Enforcing password complexity
- Hooking new functions to actions + passing parameters
- Modify custom field input data before creating a new post
- WordPress redirect redirecting too many times or not at all
- How to pass hook variable to function?
- WordPress HTML Helper
- Is there a hook that I can use when a fatal error occurs?
- what is correct way to hook when update post
- Check php version before theme activation
- Change the footer text on the login page
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- How to remove a metabox from menu editor page?
- Can i check if user is doing any ajax request?
- Check if page parent has certain template
- How to Remove a Filter from the Admin List Table?
- Find variables available at a given hook
- Why do filters/actions require an argument count?
- Is $hook a global variable in WordPress
- Delete option value from array using update_option()
- Insert all post IDs in new database table
- How to access function from outside of a class within this class in WP plugin?
- action hook wp_head higher priority as all other plugins/hooks
- How to use return in my custom function instead of echo
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Handling Body class based on Template
- Adding Default Settings to Theme My Login plugin
- Remove an action hook within a Class
- How to pass arguments to add_action() or retrieve return value of called function?
- add_action shortcut?
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Why ajax doesn’t work on certain wordpress hooks?
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Set meta field to publish date + 2 weeks
- WordPress Gravatar filter is removing my custom attributes
- Error in custom php function doesn’t exist
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Return a numerical function value in Customizer controls
- Adding widgets to my plugin page instead of WordPress dashboard
- Adding function to Genesis genesis_header [closed]
- how to make custom ajax handler?
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- jQuery code not working when included in functions.php
- Should `wp_login` be used since it’s deprecated?
- Override a function defined in wp-includes/comment-template.php
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- Password minimum length in personal subscription [closed]
- Nested “do” and “add” Actions is possible?
- Run a code only on theme activation only during first activation
- Theme not calling Jquery properly
- Are there action hooks for comments?
- How to catch wordpress post ID when it’s published
- Why does the post_type_link hook everything twice?
- How to have different site identity logos on each page on Astra Theme [closed]
- How can I hook into the wp_mail function used by BackWPup?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- How do I create a function that modifies a message in the wp-login.php file?
- Get user custom field value on function.php
- Adding function to child theme’s function.php
- Must filter functions receive all arguments passed to them?
- Creating customized php files in theme folder
- Dynamically Generate Functions and Hooks
- How do I add a function to parent theme
- Contain multiple page templates in one PHP custom template file in WordPress?
- Wp_Schedule_Event every few minutes doesn’t work
- remove_action from parent theme using child theme functions.php
- Adding custom field to product category and show it to shop/category shop page
- Custom meta box is not displaying value showing tag as empty
- Get original value in save_post action hooka
- Discount in the specific product title using keyword ( Woocoommerce )
- How do I get the value of a current user’s custom field?
- How do I remove an action hook inside a class that is called by another class?
- Getting page / post URL on publish and / or update
- remove_action() not working in page template – Genesis
- Unable to pass arguments to function used in add_action
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Why transition_post_type hook is called twice for the same post?
- Issue encountered while trying to keep website private
- Highlight posts currently being edited on multiple editor site?
- Password form redirection to belonging post
- How to add custom checkout field in user details mail template
- Cannot modify header information – headers already sent
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Why a class property becomes empty?
- transition_post_status hook, works – but not if the post is new
- Execute wp_after_insert_post after the permalink is customized
- Add 2 links in between the navigation using the Breadcrumb Navxt plugin hook
- Disable RSS /feed/ endpoints on posts without disabling RSS overall
- How to set and use global variables? Or why not to use them at all
- Sending the reset password link programatically
- How can I see all the actions attached to an “add_action” hook?
- How to deprecate a function used in a plugin?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- How to make a image-size selected by default in Media upload – WP v3.5
- What is This esc_html_e() i wordpress php?
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Function to return true if current page has child pages
- How do I change/modify the_post_thumbnail(); html output?