Action uncanny-learndash-toolkit

uo_forgot_after_success_message

Fires after a successful password reset request message is displayed.

add_action( 'uo_forgot_after_success_message', $callback, 10, 1 );

Description

Fires after a successful password reset email has been sent. Developers can use this hook to display additional messages, log the event, or trigger other actions immediately after the success message is shown on the frontend.


Usage

add_action( 'uo_forgot_after_success_message', 'your_function_name', 10, 1 );

Examples

/**
 * Fires after the success message is displayed for a password reset request.
 * This action hook can be used to append additional information or perform
 * follow-up actions after the user has been notified about their password reset.
 *
 * @param WP_Error|object $forgot_password_response The response object from the password reset process.
 *                                                This object typically contains a 'message' property with the success message.
 */
add_action( 'uo_forgot_after_success_message', function( $forgot_password_response ) {
	// Example: Log the success event for debugging or auditing purposes.
	if ( ! empty( $forgot_password_response ) && isset( $forgot_password_response->message ) ) {
		// In a real scenario, you might want to sanitize or format the message before logging.
		error_log( 'Password reset success message displayed: ' . sanitize_text_field( $forgot_password_response->message ) );

		// You could also add a small, additional note to the user if needed,
		// though this is generally handled by the template itself.
		// echo '<p>Please check your email for further instructions.</p>';
	}
}, 10, 1 ); // Priority 10, accepts 1 argument.

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/templates/frontend-login/modern_ui-lost-pwd.php:51
src/templates/frontend-login/layout_1-lost-pwd.php:44
src/classes/frontend-login-plus.php:3556

<?php do_action( 'uo_forgot_before_success' ); ?>

					<div class="ult-form__row ult-form__row--validation">
						<div class="ult-notice ult-notice--success">
							<?php do_action( 'uo_forgot_before_success_message' ); ?>
							<?php echo $forgot_password_response->message; ?>
							<?php do_action( 'uo_forgot_after_success_message' ); ?>
						</div>
					</div>
					
					<?php do_action( 'uo_forgot_after_success' ); ?>
				
				<?php } else { ?>


Scroll to Top