-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathform-registration.php
100 lines (75 loc) · 2.4 KB
/
form-registration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/**
* Registration Form
*
* @package LifterLMS/Templates/Global
*
* @since 3.0.0
* @since 5.0.0 Utilize fields from LLMS_Forms.
* @version 5.0.0
*/
defined( 'ABSPATH' ) || exit;
$form_title = llms_get_form_title( 'registration' );
$form_fields = llms_get_form_html( 'registration' );
/**
* Filters whether or not the registration form should be displayed
*
* By default, the registration form is hidden from logged-in users and
* displayed to logged out users.
*
* @since 4.16.0
*
* @param boolean $hide_form Whether or not to hide the form. If `true`, the form is hidden, otherwise it is displayed.
*/
if ( apply_filters( 'llms_hide_registration_form', is_user_logged_in() ) ) {
return;
}
?>
<?php llms_print_notices(); ?>
<?php do_action( 'lifterlms_before_person_register_form' ); ?>
<div class="llms-new-person-form-wrapper">
<?php if ( $form_title ) : ?>
<h2 class="llms-form-heading"><?php echo esc_html( $form_title ); ?></h2>
<?php endif; ?>
<form method="post" class="llms-new-person-form register">
<?php do_action( 'lifterlms_register_form_start' ); ?>
<div class="llms-form-fields">
<?php do_action( 'lifterlms_before_registration_fields' ); ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $form_fields;
?>
<?php
/**
* Hook: llms_registration_privacy
*
* @hooked llms_privacy_policy_form_field - 10
* @hooked llms_agree_to_terms_form_field - 20
*/
do_action( 'llms_registration_privacy' );
?>
<?php do_action( 'lifterlms_after_registration_fields' ); ?>
</div>
<footer class="llms-form-fields">
<?php do_action( 'lifterlms_before_registration_button' ); ?>
<?php
llms_form_field(
array(
'columns' => 3,
'classes' => 'llms-button-action',
'id' => 'llms_register_person',
'value' => apply_filters( 'lifterlms_registration_button_text', __( 'Register', 'lifterlms' ) ),
'last_column' => true,
'required' => false,
'type' => 'submit',
)
);
?>
<?php do_action( 'lifterlms_after_registration_button' ); ?>
<?php wp_nonce_field( 'llms_register_person', '_llms_register_person_nonce' ); ?>
<input name="action" type="hidden" value="llms_register_person">
</footer>
<?php do_action( 'lifterlms_register_form_end' ); ?>
</form>
</div>
<?php do_action( 'lifterlms_after_person_register_form' ); ?>