Action uncanny-learndash-toolkit

uo_reset_before_container

Fires before the main container for resetting content is outputted, allowing for custom modifications.

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

Description

Fires before the main container for the password reset form is outputted. This hook is useful for adding custom content, modifying the form's structure, or integrating other functionalities directly before the password reset form begins on the frontend.


Usage

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

Examples

<?php
/**
 * Example: Add a custom message before the password reset form.
 *
 * This function demonstrates how to hook into 'uo_reset_before_form'
 * to inject custom HTML content just before the password reset form.
 *
 * @param array $reset_password_params An array of parameters passed to the reset password template.
 * @return void
 */
function my_uncanny_reset_before_form_message( $reset_password_params ) {
    // Check if the reset password token is valid. This is a simplified check.
    // In a real-world scenario, you'd likely have more robust validation.
    if ( isset( $reset_password_params['token_valid'] ) && true === $reset_password_params['token_valid'] ) {
        echo '<div class="custom-reset-message" style="background-color: #e7f3fe; border-left: 6px solid #2196F3; padding: 15px; margin-bottom: 20px;">';
        echo '<p><strong>Important:</strong> Please ensure you are creating a strong password to protect your account.</p>';
        echo '</div>';
    } else {
        // Optionally display a message if the token is not valid or not provided.
        echo '<div class="custom-reset-message error" style="background-color: #ffdddd; border-left: 6px solid #f44336; padding: 15px; margin-bottom: 20px;">';
        echo '<p><strong>Note:</strong> The password reset link may have expired or is invalid.</p>';
        echo '</div>';
    }
}
add_action( 'uo_reset_before_form', 'my_uncanny_reset_before_form_message', 10, 1 ); // Hook into 'uo_reset_before_form' with priority 10 and 1 accepted argument.

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:6
src/templates/frontend-login/modern_ui-reset-pwd.php:29
src/templates/frontend-login/layout_1-reset-pwd.php:29

<?php

namespace uncanny_learndash_toolkit;

?>
<?php do_action( 'uo_reset_before_container' ); ?>
<?php do_action( 'uo_reset_before_title' ); ?>
<h2><?php echo $innerText['Reset-Password-Title']; ?></h2>
<?php do_action( 'uo_reset_before_description' ); ?>
<p><?php echo $innerText['Reset-Password-Desc']; ?></p>
<?php do_action( 'uo_reset_before_form' ); ?>
<form name="resetpassform" id="resetpassform" action="?action=validatepasswordreset" method="post" autocomplete="off">
	<?php if ( ! empty( $error ) ) { ?>


Scroll to Top