upskill-event-manager/hvac-community-events/templates/community/login-form.php

67 lines
No EOL
2.4 KiB
PHP

<?php
/**
* HVAC Community Events: Custom Login Form Template
*
* This template provides the structure for the custom login page,
* integrating with the Astra theme's styling.
*
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Get Astra theme layout settings if needed, e.g., container width
// $container_class = astra_get_content_layout(); // Example
?>
<div class="hvac-community-login-wrapper"> <?php // Custom wrapper for potential styling ?>
<div class="ast-container"> <?php // Astra theme container ?>
<div class="hvac-login-form-card"> <?php // Card styling based on design reference ?>
<?php
// Display login errors if any
// Example: Check for login errors passed via query parameters or session
// if ( isset( $_GET['login'] ) && $_GET['login'] === 'failed' ) {
// echo '<p class="login-error">Invalid username or password.</p>';
// }
?>
<?php
// Arguments for wp_login_form
$args = array(
'echo' => true,
// 'redirect' is handled by the 'login_redirect' filter in Login_Handler class
'form_id' => 'hvac_community_loginform',
'label_username' => __( 'Username or Email Address', 'hvac-community-events' ),
'label_password' => __( 'Password', 'hvac-community-events' ),
'label_remember' => __( 'Remember Me', 'hvac-community-events' ), // Task 2.3
'label_log_in' => __( 'Log In', 'hvac-community-events' ),
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true, // Task 2.3
'value_username' => '',
'value_remember' => false, // Set to true to default the checkbox to checked
);
wp_login_form( $args );
?>
<div class="hvac-login-links">
<?php if ( get_option( 'users_can_register' ) ) : ?>
<a class="hvac-register-link" href="<?php echo esc_url( wp_registration_url() ); ?>">
<?php esc_html_e( 'Register', 'hvac-community-events' ); ?>
</a> |
<?php endif; ?>
<a class="hvac-lostpassword-link" href="<?php echo esc_url( wp_lostpassword_url() ); ?>">
<?php esc_html_e( 'Lost your password?', 'hvac-community-events' ); // Task 2.4 ?>
</a>
</div>
</div> <?php // .hvac-login-form-card ?>
</div> <?php // .ast-container ?>
</div> <?php // .hvac-community-login-wrapper ?>