uo_reset_before_description
Fires before the user profile description is reset, allowing for modifications to the process.
add_action( 'uo_reset_before_description', $callback, 10, 1 );
Description
Fires before the reset password description is displayed. Developers can use this hook to add custom content or modify the existing description output for password reset forms. It provides an opportunity to inject additional instructions or information pertinent to the password reset process.
Usage
add_action( 'uo_reset_before_description', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Example function to display a custom message before the reset password description.
* This function is hooked to the 'uo_reset_before_description' action.
*
* @since 1.0.0
*/
function ulgc_display_custom_reset_message() {
// Check if the current user is logged out, as this action is typically used on the reset password page.
if ( ! is_user_logged_in() ) {
// You can access global variables if needed, for example, to retrieve the reset token or username.
// For this example, we'll just display a static message.
echo '<div class="custom-reset-message" style="background-color: #e0f7fa; border: 1px solid #00acc1; padding: 10px; margin-bottom: 15px; border-radius: 5px;">';
echo '<p><strong>Important:</strong> Please ensure you are using the correct email address associated with your account.</p>';
echo '</div>';
}
}
// Add the action hook.
// The second parameter '10' is the priority, meaning it will run after default actions at priority 10.
// The third parameter '0' indicates that this function does not accept any arguments from the hook.
add_action( 'uo_reset_before_description', 'ulgc_display_custom_reset_message', 10, 0 );
?>
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:9
src/templates/frontend-login/modern_ui-reset-pwd.php:49
src/templates/frontend-login/layout_1-reset-pwd.php:42
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 ) ) { ?>
<?php do_action( 'uo_reset_before_error' ); ?>
<p>
<?php do_action( 'uo_reset_before_error_message' ); ?>