uo_reset_after_form
Fires after the user profile reset form has been submitted, allowing for custom actions.
add_action( 'uo_reset_after_form', $callback, 10, 1 );
Description
Fires after the password reset form is displayed but before the submit button. Developers can use this hook to add custom fields, modify existing ones, or insert additional content before the form submission process begins, ensuring seamless integration with the reset password workflow.
Usage
add_action( 'uo_reset_after_form', 'your_function_name', 10, 1 );
Examples
add_action( 'uo_reset_after_form', 'my_custom_reset_form_actions', 10, 1 );
/**
* Performs custom actions after the password reset form is displayed.
*
* This example demonstrates how to add additional fields or logic
* after the main password reset form has been rendered, but before
* the form is closed or further processing occurs.
*
* @param array $args Arguments passed to the hook. Can be used to pass contextual data.
*/
function my_custom_reset_form_actions( $args ) {
// Example: Add a hidden field for a custom tracking ID if it exists in arguments.
if ( isset( $args['tracking_id'] ) && ! empty( $args['tracking_id'] ) ) {
printf( '<input type="hidden" name="custom_tracking_id" value="%s" />', esc_attr( $args['tracking_id'] ) );
}
// Example: Display a message for users who might have navigated here directly.
// This is just illustrative; actual logic would depend on context.
if ( isset( $args['user_email'] ) && ! empty( $args['user_email'] ) ) {
printf( '<p class="description">If you did not request a password reset for %s, please ignore this email.</p>', esc_html( $args['user_email'] ) );
}
// Example: Add a nonce field for extra security if this hook is used for form submission processing.
// In this context, it's after the form, so this would be for *subsequent* actions.
// For simplicity in this example, we'll just assume it might be useful for later steps.
wp_nonce_field( 'uo_reset_form_action', 'uo_reset_form_nonce' );
}
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:60
src/templates/frontend-login/modern_ui-reset-pwd.php:150
src/templates/frontend-login/layout_1-reset-pwd.php:143
<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"
class="button button-primary button-large"
value="<?php echo $innerText['Reset-Password-Button']; ?>"/></p>
<?php do_action( 'uo_reset_after_submit' ); ?>
</form>
<?php do_action( 'uo_reset_after_form' ); ?>
<?php do_action( 'uo_reset_after_container' ); ?>