Action uncanny-learndash-toolkit

uo_forgot_before_captcha

Fires before the reCAPTCHA verification process on the password reset form.

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

Description

Fires before the reCAPTCHA field in the "Forgot Password" form. Developers can use this action to add custom fields, perform validation, or inject additional elements before the captcha is displayed.


Usage

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

Examples

// Example function to display a custom message before the reCAPTCHA on the forgot password form.
// This action hook is triggered just before the reCAPTCHA field is rendered.
function my_custom_forgot_password_message() {
    // You could conditionally display a message, for example, if a specific plugin is active.
    if ( class_exists( 'ACF' ) ) {
        echo '<p class="ult-form__note">Please complete the security check below.</p>';
    }
}
add_action( 'uo_forgot_before_captcha', 'my_custom_forgot_password_message', 10, 0 ); // 10 is the priority, 0 is the number of accepted arguments.

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:102
src/templates/frontend-login/layout_1-lost-pwd.php:95

</div>

								<div class="ult-form__field">
									<input required type="text" name="user_login" id="ult-forgot-email" class="ult-form__input" placeholder="">
								</div>
							</div>
							
							<?php do_action( 'uo_forgot_before_captcha' ); ?>
							
							<?php if ( $has_recaptcha ) { ?>

								<div class="ult-form__row ult-form__row--recaptcha">
									<div class="ult-form-recaptcha" data-sitekey="<?php echo $recaptcha_key; ?>" data-callback="UncannyToolkitFrontendLoginReCaptchaCorrect"></div>
								</div>


Scroll to Top