Action uncanny-learndash-toolkit

uo_login_before_container

Fires before the main login form container is rendered, allowing customization of the login page structure.

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

Description

Fires before the main login form container is output. Developers can use this hook to add custom content, modify the existing content, or perform actions directly before the login form structure begins, providing fine-grained control over the login page's pre-container elements.


Usage

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

Examples

/**
 * Example of how to use the 'uo_login_before_container' action hook.
 * This example adds a custom message before the login form container.
 */
add_action( 'uo_login_before_container', 'my_custom_login_message' );

function my_custom_login_message() {
	// Check if the user is logged in. If so, display a different message.
	if ( is_user_logged_in() ) {
		echo '<p class="woocommerce-form-row woocommerce-form-row--last woocommerce-notice">You are already logged in.</p>';
	} else {
		echo '<p class="woocommerce-form-row woocommerce-form-row--last woocommerce-info">Welcome! Please log in to access your account.</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:145
src/templates/frontend-login/modern_ui-login.php:145

$content .= $output;

	return $content;
}, 10, 1 );

?>

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

<div id="ult-login">

	<div class="ult-box">

		<div class="ult-form__content">


Scroll to Top