Action uncanny-learndash-toolkit

uo_reset_confirm_password_actions

Fires after the password reset confirmation form is submitted and processed.

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

Description

Fires after the confirm password field is displayed but before the submit button on the reset password form. Developers can use this hook to add custom fields, modify form elements, or perform actions before the password reset submission.


Usage

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

Examples

<?php
/**
 * Add a strength indicator and a password policy reminder below the confirm password field.
 *
 * This hook is triggered within the WordPress password reset form, specifically
 * after the "Confirm Password" field and before the submit button.
 */
add_action( 'uo_reset_confirm_password_actions', 'my_custom_password_reset_fields', 10, 0 );

function my_custom_password_reset_fields() {
    // Output a password strength indicator.
    // In a real-world scenario, you might enqueue a script here that
    // dynamically updates a strength indicator as the user types.
    echo '<div id="password-strength-meter"></div>';

    // Display a reminder about password policy, assuming $innerText is available.
    // If $innerText is not globally available or passed, you'd need to fetch it
    // or define it here. For this example, we assume it's accessible.
    global $innerText; // Assuming $innerText is accessible globally or via context
    if ( isset( $innerText['Password-Policy-Reminder'] ) ) {
        echo '<p class="password-policy-reminder">' . esc_html( $innerText['Password-Policy-Reminder'] ) . '</p>';
    }
}

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/default-reset-pwd.php:48
src/templates/frontend-login/modern_ui-reset-pwd.php:94
src/templates/frontend-login/layout_1-reset-pwd.php:87

</div>
	<?php do_action( 'uo_reset_before_confirm_password' ); ?>
    <p class="user-pass2-wrap">
        <label for="pass2"><?php echo $innerText['Confirm-Password']; ?></label><br/>
        <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" required/>
    </p>
    <div class="wp-pwd">
		<?php do_action( 'uo_reset_confirm_password_actions' ); ?>
    </div>
	<?php do_action( 'uo_reset_before_captcha' ); ?>
    <!--	<p class="description indicator-hint">--><?php /*echo $innerText['Password-Indicator-Hint'];*/ ?><!--</p>-->
    <br class="clear"/>
    <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>"/>
	<?php do_action( 'uo_reset_before_submit' ); ?>
    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit"


Scroll to Top