admin-import-user-part-instructions.php
8.96 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( \uncanny_pro_toolkit\ImportLearndashUsersFromCsv::is_learndash_active() ) {
$csv_sample_file_link = plugins_url( basename( dirname( UO_FILE ) ) ) . '/src/assets/legacy/backend/csv/import_user_sample.csv';
} else {
$csv_sample_file_link = plugins_url( basename( dirname( UO_FILE ) ) ) . '/src/assets/legacy/backend/csv/import_user_sample_generic.csv';
}
?>
<div id="import-users-instructions">
<p>
<em>
<?php
if ( \uncanny_pro_toolkit\ImportLearndashUsersFromCsv::is_learndash_active() ) {
esc_attr_e( 'This is a complex module that allows users to be added to courses and LearnDash Groups from a CSV file. The Options tab includes settings that control how updates to users are managed and bulk imported into specific courses and groups.', 'uncanny-pro-toolkit' );
} else {
esc_attr_e( 'This is a complex module that allows users to be added to your site from a CSV file. The Options tab includes settings that control how updates to users are managed and bulk imported.', 'uncanny-pro-toolkit' );
}
?>
<?php esc_attr_e( 'The Emails tab includes settings that control whether to send notifications to imported users and the email templates. These settings should be reviewed before proceeding with the import. Download the sample CSV on this page to see examples of the fields that can be included.', 'uncanny-pro-toolkit' ); ?>
</em>
</p>
<p>
<?php
$kb_link = '<a href="https://www.uncannyowl.com/knowledge-base/import-learndash-users/">' . esc_attr__( 'Knowledge Base article', 'uncanny-pro-toolkit' ) . '</a>';
echo sprintf( __( 'You should also review the %s which includes more detailed explanations and specific instructions for different use cases.', 'uncanny-pro-toolkit' ), $kb_link ); ?>
</p>
<h2 class="options-header-container">
<ul class="steps">
<li class="current">
<a href="#" data-show="step-1" title="">
<span class="step-title"><?php esc_attr_e( 'Step 1', 'uncanny-pro-toolkit' ); ?></span>
</a>
</li>
<li></li>
</ul>
<div class="steps-description"><?php esc_attr_e( 'Review Options', 'uncanny-pro-toolkit' ); ?></div>
</h2>
<p><?php esc_attr_e( 'Use this tab to configure:', 'uncanny-pro-toolkit' ); ?></p>
<ul class="import-user-list">
<li><?php esc_attr_e( 'Whether to update or ignore users that already exist on your website', 'uncanny-pro-toolkit' ); ?></li>
<li><?php esc_attr_e( 'Role to assign to imported users', 'uncanny-pro-toolkit' ); ?></li>
<?php
if ( \uncanny_pro_toolkit\ImportLearndashUsersFromCsv::is_learndash_active() ) {
?>
<li><?php esc_attr_e( 'Course(s) to enroll imported users into', 'uncanny-pro-toolkit' ); ?></li>
<li><?php esc_attr_e( 'LearnDash Group(s) to assign imported users to', 'uncanny-pro-toolkit' ); ?></li>
<?php
} ?>
</ul>
<h2 class="options-header-container">
<ul class="steps">
<li class="current">
<a href="#" data-show="step-1" title="">
<span class="step-title"><?php esc_attr_e( 'Step 2', 'uncanny-pro-toolkit' ); ?></span>
</a>
</li>
<li></li>
</ul>
<div class="steps-description"><?php esc_attr_e( 'Review Email Settings', 'uncanny-pro-toolkit' ); ?></div>
</h2>
<p><?php esc_attr_e( 'Use this tab to:', 'uncanny-pro-toolkit' ); ?></p>
<ul class="import-user-list">
<li><?php esc_attr_e( 'Enable email notifications to new and/or updated users', 'uncanny-pro-toolkit' ); ?></li>
<li><?php esc_attr_e( 'Customize email templates', 'uncanny-pro-toolkit' ); ?></li>
</ul>
<h2 class="options-header-container">
<ul class="steps">
<li class="current">
<a href="#" data-show="step-1" title="">
<span class="step-title"><?php esc_attr_e( 'Step 3', 'uncanny-pro-toolkit' ); ?></span>
</a>
</li>
<li></li>
</ul>
<div class="steps-description"><?php esc_attr_e( 'Create a CSV File', 'uncanny-pro-toolkit' ); ?>
<a class="options"
href="<?php echo $csv_sample_file_link; ?>"><?php esc_attr_e( 'Download Sample CSV', 'uncanny-pro-toolkit' ); ?></a>
</div>
</h2>
<p>
<?php esc_attr_e( 'Your CSV file must be comma-delimited with a .csv extension. It requires user_login and user_email columns, and can include any number of optional meta fields below.', 'uncanny-pro-toolkit' ); ?>
</p>
<h2><?php esc_attr_e( 'Available Meta Fields', 'uncanny-pro-toolkit' ); ?></h2>
<table class="wp-list-table widefat fixed striped posts">
<thead>
<tr>
<td><?php esc_attr_e( 'Column Heading', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'Description', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'Required/Optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo 'user_email'; ?></td>
<td><?php esc_attr_e( 'The user\'s email', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'required', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'user_login'; ?></td>
<td><?php esc_attr_e( 'The user\'s username', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'user_pass'; ?></td>
<td><?php esc_attr_e( 'The user\'s password', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<?php if ( \uncanny_pro_toolkit\ImportLearndashUsersFromCsv::is_learndash_active() ) { ?>
<tr>
<td><?php echo 'learndash_courses'; ?></td>
<td>
<?php esc_attr_e( 'One or more courses to enroll the user into, specified by course ID. If this column exists and cell is empty, course(s) in Options will be used. Multiple course IDs must be separated by semi-colons, e.g., 96;107;92', 'uncanny-pro-toolkit' ); ?>
</td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'learndash_groups'; ?></td>
<td>
<?php esc_attr_e( 'One or more LearnDash groups to enroll the user into, specified by group ID. If this column exists and cell is empty, group(s) in Options will be used. Multiple group IDs must be separated by semi-colons, e.g., 91;102;98', 'uncanny-pro-toolkit' ); ?>
</td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<?php } ?>
<tr>
<td><?php echo 'wp_role'; ?></td>
<td>
<?php esc_attr_e( 'Role to assign to the imported user, specified by role slug. If this column exists and cell is empty, the role in Options will be used.', 'uncanny-pro-toolkit' ); ?>
<br> <b><?php esc_attr_e( 'Available role slugs:', 'uncanny-pro-toolkit' ); ?></b>
<?php
$rr = array();
foreach ( get_editable_roles() as $role_name => $role_info ): ?>
<?php $rr[] = $role_name; ?>
<?php endforeach; ?>
<?php echo join( ', ', $rr ) ?>
</td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'first_name'; ?></td>
<td><?php esc_attr_e( 'The user\'s first name', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'last_name'; ?></td>
<td><?php esc_attr_e( 'The user\'s last name', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<tr>
<td><?php echo 'display_name'; ?></td>
<td><?php esc_attr_e( 'The user\'s display name', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<?php if ( \uncanny_pro_toolkit\ImportLearndashUsersFromCsv::is_learndash_active() ) { ?>
<tr>
<td><?php echo 'group_leader'; ?></td>
<td>
<?php esc_attr_e( 'Assign the associated user to a group as a Group Leader and add the Group Leader role. Separate multiple group IDs by semicolons, e.g., 91;102;98 if the user will be added to multiple groups as a Group Leader.', 'uncanny-pro-toolkit' ); ?>
</td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
<?php } ?>
<tr>
<td><?php echo '**'; ?></td>
<td><?php esc_attr_e( 'Any other meta column heading will be treated as a custom user meta value', 'uncanny-pro-toolkit' ); ?></td>
<td><?php esc_attr_e( 'optional', 'uncanny-pro-toolkit' ); ?></td>
</tr>
</tbody>
</table>
<h2><?php esc_attr_e( 'Notes:', 'uncanny-pro-toolkit' ); ?></h2>
<ul class="import-user-list">
<li><?php esc_attr_e( 'If no password value is present for new users, a password will be auto-generated.', 'uncanny-pro-toolkit' ); ?></li>
<li><?php esc_attr_e( 'Username and email address cannot be updated via import.', 'uncanny-pro-toolkit' ); ?></li>
</ul>
<h2 class="options-header-container">
<ul class="steps">
<li class="current">
<a href="#" data-show="step-1" title="">
<span class="step-title"><?php esc_attr_e( 'Step 4', 'uncanny-pro-toolkit' ); ?></span>
</a>
</li>
<li></li>
</ul>
<div class="steps-description"><?php esc_attr_e( 'Import Users', 'uncanny-pro-toolkit' ); ?></div>
</h2>
<p><?php esc_attr_e( 'Go to the Import Users tab once your CSV file is ready to begin the import.', 'uncanny-pro-toolkit' ); ?></p>
</div>