Action uncanny-learndash-toolkit

uo_reset_before_title

Fires before the reset password form title is displayed.

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

Description

Fires immediately before the reset password form title is displayed. Allows developers to inject custom content or modify the surrounding structure before the title appears in Uncanny Owl's default, modern, and layout_1 reset password templates.


Usage

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

Examples

add_action( 'uo_reset_before_title', 'my_custom_reset_title_hook', 10 );

/**
 * Example function to hook into 'uo_reset_before_title'.
 * This function adds a custom message before the reset password title.
 *
 * @param array $args  (Potentially passed arguments, though this hook doesn't pass any by default based on the source).
 */
function my_custom_reset_title_hook() {
    // Check if we are in the context of a password reset process and if a specific user object is available.
    // In a real-world scenario, you might check for user sessions or other context clues.
    // For this example, we'll assume a simple addition is always desired.
    ?>
    <div class="custom-reset-message">
        <p><strong>Please enter your new password below.</strong></p>
    </div>
    <?php
}
// The 'uo_reset_before_title' hook is an action hook, so no return statement is needed.
// The accepted arguments count for this hook is 0 as no parameters are passed by default.
// We explicitly set the priority to 10 (the default).

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

<?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 ) ) { ?>
		<?php do_action( 'uo_reset_before_error' ); ?>


Scroll to Top