You want to change the “Your password has been reset.” message.
You say you’ve tried the login_message filter and that should work, so your problem is likely that your code isn’t getting loaded. Put your filter code in a mu-plugin not a regular plugin to ensure it gets loaded for the login page. Rather than testing for the action I’d test if the message contains __( 'Your password has been reset.' )
instead.
Here’s the code from wp-login.php:
login_header(
__( 'Password Reset' ),
wp_get_admin_notice(
__( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a>',
array(
'type' => 'info',
'additional_classes' => array( 'message', 'reset-pass' ),
)
)
);
As you can see there’s nothing obvious to filter there. You could also
- Use a gettext filter to catch exact matches for “Your password has been reset.” and replace it with your own string, e.g. see this answer. I don’t particularly like this, but you’re already having to check for a text match 🤷‍♀️ so maybe it’s not too bad.
- Filter wp_admin_notice_markup instead. Here you could check for the reset case using the additional_classes argument containing reset-pass, but you’re going to have to make a string substitution into the message mark-up too, so this isn’t very nice either.
So there aren’t any particularly good options here, sorry.