Action uncanny-learndash-toolkit

uo_login_before_footer

Fires before the footer is displayed on the login page.

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

Description

Fires before the login form footer. Developers can use this action to inject custom content, scripts, or modify the layout immediately before the login form's footer section begins. This hook is part of the core frontend login template.


Usage

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

Examples

<?php
/**
 * Example: Add a custom message before the login form footer.
 *
 * This function will be hooked into the 'uo_login_before_footer' action
 * to display a custom message or link before the main login form footer elements.
 */
function my_custom_login_before_footer_message() {
	// Check if the current page is the login page.
	// This is a basic check; more robust checks might involve global variables or page templates.
	if ( is_page( 'login' ) || ( isset( $_GET['action'] ) && $_GET['action'] === 'login' ) ) {
		echo '<p class="login-custom-message">Welcome back! Please log in to access your account.</p>';
		echo '<a href="' . esc_url( home_url( '/register/' ) ) . '" class="register-link">Don't have an account? Register here!</a>';
	}
}
add_action( 'uo_login_before_footer', 'my_custom_login_before_footer_message', 10 );

/**
 * Example: Add a security notice before the login form footer.
 *
 * This function demonstrates adding a security-related message.
 */
function my_login_security_notice() {
	echo '<p class="login-security-notice"><strong>Security Notice:</strong> Please do not share your password with anyone.</p>';
}
add_action( 'uo_login_before_footer', 'my_login_security_notice', 20 );

/**
 * Example: Log a message when the login form is being rendered.
 *
 * This is more for debugging or advanced logging purposes.
 */
function log_login_form_rendering() {
	// In a real scenario, you might log to a file or a custom database table.
	// For this example, we'll use error_log which typically goes to the server's error log.
	error_log( 'Login form is about to render footer elements.' );
}
add_action( 'uo_login_before_footer', 'log_login_form_rendering', 30 );
?>

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/layout_1-login.php:202
src/templates/frontend-login/modern_ui-login.php:209

do_action( 'login_form' );
						wp_login_form( $login_form_args );
					}
				?>

			</div>

			<?php do_action( 'uo_login_before_footer' ); ?>

		</div>

		<div class="ult-form__footer">

			<?php do_action( 'uo_login_before_forgot_password' ); ?>


Scroll to Top