uo_login_before_title
Fires just before the login form title is displayed on the login page.
add_action( 'uo_login_before_title', $callback, 10, 1 );
Description
Fires before the login form's title is displayed. Developers can use this hook to add content or modify elements directly before the login title, allowing for custom pre-title content or styling.
Usage
add_action( 'uo_login_before_title', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Add a custom message before the login form title.
*
* This function demonstrates how to use the 'uo_login_before_title' action hook
* to inject custom content right before the login form's title is displayed.
*
* @param ModernUILogin $login The login object, providing access to configuration and strings.
*/
add_action( 'uo_login_before_title', function( $login ) {
// Check if a specific query parameter exists in the URL, indicating a forced logout due to inactivity.
if ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] === 'true' ) {
echo '<p class="uo-login-message uo-login-message--info">You have been logged out due to inactivity. Please log in again.</p>';
}
} );
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:167
src/templates/frontend-login/modern_ui-login.php:174
<?php echo $reset_password_sucess; ?>
<?php do_action( 'uo_login_before_reset_success_message' ); ?>
</div>
<?php } ?>
<?php do_action( 'uo_login_before_title' ); ?>
<?php if ( $login->config->show_title ){ ?>
<div class="ult-form__title">
<?php echo $login->strings->title; ?>
</div>