PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.2.0
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.2.0
4.4.10 4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 All 142 releases
learnpress / templates / profile / tabs / settings / basic-information.php

basic-information.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.2.0, at templates/profile/tabs/settings/basic-information.php

145 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying editing basic information form of user in profile page.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/settings/tabs/basic-information.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 4.0.0
10 */
11
12 defined( 'ABSPATH' ) || exit();
13
14 $profile = LP_Profile::instance();
15
16 if ( ! isset( $section ) ) {
17 $section = 'basic-information';
18 }
19
20 $user = $profile->get_user();
21 ?>
22
23 <form method="post" id="learn-press-profile-basic-information" name="profile-basic-information" enctype="multipart/form-data" class="learn-press-form">
24
25 <?php do_action( 'learn-press/before-profile-basic-information-fields', $profile ); ?>
26
27 <ul class="form-fields">
28
29 <?php do_action( 'learn-press/begin-profile-basic-information-fields', $profile ); ?>
30
31
32 <li class="form-field form-field__first-name form-field__50">
33 <label for="first_name"><?php esc_html_e( 'First name', 'learnpress' ); ?></label>
34 <div class="form-field-input">
35 <input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $user->get_data( 'first_name' ) ); ?>" class="regular-text">
36 </div>
37 </li>
38 <li class="form-field form-field__last-name form-field__50">
39 <label for="last_name"><?php esc_html_e( 'Last name', 'learnpress' ); ?></label>
40 <div class="form-field-input">
41 <input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $user->get_data( 'last_name' ) ); ?>" class="regular-text">
42 </div>
43 </li>
44 <li class="form-field form-field__last-name form-field__50">
45 <label for="account_display_name"><?php esc_html_e( 'Display name', 'learnpress' ); ?><span class="required">*</span></label>
46 <div class="form-field-input">
47 <input type="text" name="account_display_name" id="account_display_name" value="<?php echo esc_attr( $user->get_data( 'display_name' ) ); ?>" class="regular-text">
48 </div>
49 </li>
50 <li class="form-field form-field__last-name form-field__50">
51 <label for="account_email"><?php esc_html_e( 'Email address', 'learnpress' ); ?><span class="required">*</span></label>
52 <div class="form-field-input">
53 <input type="email" name="account_email" id="account_email" value="<?php echo esc_attr( $user->get_data( 'email' ) ); ?>" class="regular-text">
54 </div>
55 </li>
56
57 <li class="form-field form-field__bio form-field__clear">
58 <label for="description"><?php esc_html_e( 'Biographical Info', 'learnpress' ); ?></label>
59 <div class="form-field-input">
60 <?php
61 echo sprintf(
62 '%s%s%s',
63 '<textarea name="description" id="description" rows="5" cols="30">',
64 esc_html( $user->get_data( 'description' ) ),
65 '</textarea>'
66 );
67 ?>
68 <p class="description"><?php esc_html_e( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'learnpress' ); ?></p>
69 </div>
70 </li>
71
72 <?php
73 $custom_profile = lp_get_user_custom_register_fields( $user->ID );
74 $custom_fields = LP_Settings::instance()->get( 'register_profile_fields' );
75
76 if ( $custom_fields ) {
77 foreach ( $custom_fields as $field ) {
78 ?>
79 <li class="form-field form-field__<?php echo esc_attr( $field['id'] ); ?> form-field__clear">
80 <?php
81 switch ( $field['type'] ) {
82 case 'text':
83 case 'number':
84 case 'email':
85 case 'url':
86 case 'tel':
87 ?>
88 <label for="description"><?php echo esc_html( $field['name'] ); ?></label>
89 <input name="_lp_custom_register[<?php echo esc_attr( $field['id'] ); ?>]" type="<?php echo esc_attr( $field['type'] ); ?>" class="regular-text" value="<?php echo esc_attr( $custom_profile[ $field['id'] ] ?? '' ); ?>">
90 <?php
91 break;
92 case 'textarea':
93 ?>
94 <label for="description"><?php echo esc_html( $field['name'] ); ?></label>
95 <textarea name="_lp_custom_register[<?php echo esc_attr( $field['id'] ); ?>]"><?php echo isset( $custom_profile[ $field['id'] ] ) ? esc_textarea( $custom_profile[ $field['id'] ] ) : ''; ?></textarea>
96 <?php
97 break;
98 case 'checkbox':
99 ?>
100 <label>
101 <input name="_lp_custom_register[<?php echo esc_attr( $field['id'] ); ?>]" type="<?php echo esc_attr( $field['type'] ); ?>" value="1" <?php echo isset( $custom_profile[ $field['id'] ] ) ? checked( $custom_profile[ $field['id'] ], 1 ) : ''; ?>>
102 <?php echo esc_html( $field['name'] ); ?>
103 </label>
104 <?php
105 break;
106 }
107 ?>
108 </li>
109 <?php
110 }
111 }
112
113 // Social button.
114 $socials = learn_press_get_user_extra_profile_info( $user->get_id() );
115 if ( $socials ) {
116 foreach ( $socials as $k => $v ) {
117 if ( ! learn_press_is_social_profile( $k ) ) {
118 continue;
119 }
120 ?>
121
122 <li class="form-field form-field__profile-social form-field__50 form-field__<?php echo esc_attr( $k ); ?>">
123 <label for="description"><?php echo learn_press_social_profile_name( $k ); ?></label>
124 <div class="form-field-input">
125 <input type="text" value="<?php echo esc_attr( $v ); ?>" name="user_profile_social[<?php echo esc_attr( $k ); ?>]" placeholder="https://">
126 </div>
127 </li>
128 <?php
129 }
130 }
131 ?>
132
133 <?php do_action( 'learn-press/end-profile-basic-information-fields', $profile ); ?>
134 </ul>
135
136 <?php do_action( 'learn-press/after-profile-basic-information-fields', $profile ); ?>
137
138 <p>
139 <input type="hidden" name="save-profile-basic-information" value="<?php echo wp_create_nonce( 'learn-press-save-profile-basic-information' ); ?>"/>
140 </p>
141
142 <button type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button>
143
144 </form>
145