uo_forgot_after_submit
Fires after the forgot password form has been successfully submitted.
add_action( 'uo_forgot_after_submit', $callback, 10, 1 );
Description
Fires after the "Forgot Password" form is submitted. Developers can use this hook to perform actions immediately after the submission process, such as logging the attempt or triggering custom notifications. It's a crucial point for integrating custom post-submission logic.
Usage
add_action( 'uo_forgot_after_submit', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Example of how to use the 'uo_forgot_after_submit' action hook.
* This example logs a message to the WordPress debug log when the forgot password form is submitted.
*/
add_action( 'uo_forgot_after_submit', 'my_custom_forgot_password_log', 10, 0 );
/**
* Logs a message to the debug log after the forgot password form is submitted.
*/
function my_custom_forgot_password_log() {
// In a real-world scenario, you might want to check if a user email was actually provided
// or if the submission was successful before logging.
// For this example, we're assuming the hook fires immediately after the submit button is clicked.
if ( WP_DEBUG === true ) {
error_log( 'Forgot password form submitted. Performing custom actions...' );
// You could potentially add more complex logic here, like:
// - Sending a custom notification email
// - Triggering a marketing automation event
// - Updating a user meta field
}
}
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:146
src/templates/frontend-login/layout_1-lost-pwd.php:139
<div class="ult-form__row ult-form__row--submit">
<button type="submit" id="ult-forgot-password-submit-btn" class="ult-form__submit-btn">
<?php echo $innerText['Get-New-Password']; ?>
</button>
</div>
<?php do_action( 'uo_forgot_after_submit' ); ?>
</form>
</div>
<?php do_action( 'uo_forgot_after_form' ); ?>
<?php } ?>