Action uncanny-learndash-toolkit

uo_login_before_reset_success

Fires before the user login reset process is marked as successful.

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

Description

Fires before the password reset success message is displayed. This hook is ideal for performing custom actions immediately after a successful password reset, such as sending a custom email notification or logging the event, before the standard success message appears.


Usage

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

Examples

add_action( 'uo_login_before_reset_success', 'my_custom_login_reset_success_handler', 10, 0 );

/**
 * Handles custom actions after a password reset is successful.
 * This function can be used to log the successful reset,
 * send a notification email, or perform other custom tasks.
 *
 * The 'uo_login_before_reset_success' hook is triggered right before
 * the success message for a password reset is displayed.
 */
function my_custom_login_reset_success_handler() {
	// Example: Log the successful password reset event.
	// In a real-world scenario, you might want to log more details like the user ID or timestamp.
	if ( WP_DEBUG === true ) {
		error_log( 'User password reset successfully.' );
	}

	// Example: Trigger another custom action for further processing.
	// This allows other plugins or themes to hook into this specific point.
	do_action( 'my_custom_password_reset_logged' );

	// Example: Add a custom class to the body for styling purposes.
	// This is a common WordPress pattern.
	add_action( 'wp_body_class', function( $classes ) {
		$classes[] = 'password-reset-successful';
		return $classes;
	});
}

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/layout_1-login.php:155
src/templates/frontend-login/modern_ui-login.php:162
src/classes/frontend-login-plus.php:3809

<div class="ult-box">

		<div class="ult-form__content">
			
			<?php if ( isset( $reset_password_sucess ) && ! empty( $reset_password_sucess ) ){ ?>

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

				<div class="ult-notice ult-notice--success">
					<?php do_action( 'uo_login_before_reset_success_message' ); ?>

					<?php echo $reset_password_sucess; ?>

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


Scroll to Top