| 1 |
<?php |
| 2 |
/** |
| 3 |
* Login template (default) |
| 4 |
* |
| 5 |
* @ver 1.0.1 |
| 6 |
*/ |
| 7 |
|
| 8 |
global $aui_bs5; |
| 9 |
|
| 10 |
$css_class = !empty($args['css_class']) ? esc_attr( $args['css_class'] ) : 'border-0'; |
| 11 |
$form_title = ! empty( $args['form_title'] ) || $args['form_title']=='0' ? esc_attr__( $args['form_title'], 'userswp' ) : __( 'Login', 'userswp' ); |
| 12 |
$form_title = apply_filters( 'uwp_template_form_title', $form_title, 'login' ); |
| 13 |
$button_title = uwp_get_option( 'login_form_button_title' ); |
| 14 |
$button_title = $button_title |
| 15 |
? __( wp_unslash( $button_title ), 'userswp' ) |
| 16 |
: __( 'Login', 'userswp' ); |
| 17 |
$button_title = apply_filters( 'uwp_login_form_button_title', $button_title ); |
| 18 |
|
| 19 |
do_action( 'uwp_template_before', 'login', $args ); ?> |
| 20 |
<div class="row"> |
| 21 |
<div class="card mx-auto container-fluid p-0 <?php echo esc_attr( $css_class ); ?>" > |
| 22 |
<?php |
| 23 |
// ajax modal |
| 24 |
if(wp_doing_ajax() && $form_title != '0'){ |
| 25 |
?> |
| 26 |
<div class="modal-header"> |
| 27 |
<h5 class="modal-title"><?php echo esc_attr($form_title);?></h5> |
| 28 |
<?php |
| 29 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 30 |
'type' => 'button', |
| 31 |
'class' => 'close', |
| 32 |
'content' => ' <span aria-hidden="true">×</span>', |
| 33 |
'extra_attributes' => array('aria-label'=>esc_html__("Close","userswp"), 'data-' . ( $aui_bs5 ? 'bs-' : '' ) . 'dismiss'=>"modal") |
| 34 |
)); |
| 35 |
?> |
| 36 |
</div> |
| 37 |
<?php |
| 38 |
} |
| 39 |
?> |
| 40 |
<div class="card-body"> |
| 41 |
<?php do_action( 'uwp_template_form_title_before', 'login', $args ); |
| 42 |
|
| 43 |
if ( !wp_doing_ajax() && $form_title != '0' ) { |
| 44 |
echo '<h3 class="card-title text-center mb-4">'; |
| 45 |
echo esc_attr($form_title); |
| 46 |
echo '</h3>'; |
| 47 |
} |
| 48 |
|
| 49 |
do_action( 'uwp_template_display_notices', 'login', $args ); |
| 50 |
?> |
| 51 |
<form class="uwp-login-form uwp_form" method="post"> |
| 52 |
|
| 53 |
<?php do_action( 'uwp_template_fields', 'login', $args ); ?> |
| 54 |
|
| 55 |
<div class="uwp-remember-me custom-checkbox mb-3"> |
| 56 |
<?php |
| 57 |
$id = 'remember_me'; |
| 58 |
if(wp_doing_ajax()){$id.='_ajax';} |
| 59 |
|
| 60 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 61 |
'type' => 'checkbox', |
| 62 |
'id' => esc_html( $id ), |
| 63 |
'name' => 'remember_me', |
| 64 |
'value' => 'forever', |
| 65 |
'label' => __( 'Remember Me', 'userswp' ), |
| 66 |
)); |
| 67 |
?> |
| 68 |
</div> |
| 69 |
|
| 70 |
<?php |
| 71 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 72 |
'type' => 'submit', |
| 73 |
'class' => 'btn btn-primary btn-block text-uppercase uwp_login_submit', |
| 74 |
'content' => esc_html( $button_title ), |
| 75 |
'name' => 'uwp_login_submit', |
| 76 |
)); |
| 77 |
?> |
| 78 |
|
| 79 |
</form> |
| 80 |
|
| 81 |
<div class="uwp-footer-links"> |
| 82 |
<div class="uwp-footer-link d-inline-block"> |
| 83 |
<?php |
| 84 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 85 |
'type' => 'a', |
| 86 |
'href' => esc_url( uwp_get_register_page_url() ), |
| 87 |
'class' => 'd-block text-center mt-2 small uwp-register-link', |
| 88 |
'content' => esc_attr( uwp_get_option("register_link_title") ? uwp_get_option("register_link_title") : __( 'Create account', 'userswp' ) ), |
| 89 |
'extra_attributes' => array('rel'=>'nofollow') |
| 90 |
)); |
| 91 |
?> |
| 92 |
</div> |
| 93 |
<div class="uwp-footer-link float-right"> |
| 94 |
<?php |
| 95 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 96 |
'type' => 'a', |
| 97 |
'href' => esc_url( uwp_get_forgot_page_url() ), |
| 98 |
'class' => 'd-block text-center mt-2 small uwp-forgot-password-link', |
| 99 |
'content' => esc_attr( uwp_get_option("forgot_link_title") ? uwp_get_option("forgot_link_title") : __( 'Forgot password?', 'userswp' ) ), |
| 100 |
'extra_attributes' => array('rel'=>'nofollow') |
| 101 |
)); |
| 102 |
?> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
|
| 106 |
<div class="form-group text-center mb-0 p-0"> |
| 107 |
<?php do_action( 'uwp_social_fields', 'login', $args ); ?> |
| 108 |
</div> |
| 109 |
|
| 110 |
</div> |
| 111 |
</div> |
| 112 |
</div> |
| 113 |
<?php do_action( 'uwp_template_after', 'login', $args ); ?> |