PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
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 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / templates / profile / tabs / settings / basic-information.php

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

140 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 <textarea name="description" id="description" rows="5" cols="30">
61 <?php echo esc_html( $user->get_data( 'description' ) ); ?>
62 </textarea>
63 <p class="description"><?php esc_html_e( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'learnpress' ); ?></p>
64 </div>
65 </li>
66
67 <?php
68 $custom_profile = lp_get_user_custom_register_fields( $user->ID );
69 $custom_fields = LP_Settings::instance()->get( 'register_profile_fields' );
70
71 if ( $custom_fields ) {
72 foreach ( $custom_fields as $field ) {
73 ?>
74 <li class="form-field form-field__<?php echo esc_attr( $field['id'] ); ?> form-field__clear">
75 <?php
76 switch ( $field['type'] ) {
77 case 'text':
78 case 'number':
79 case 'email':
80 case 'url':
81 case 'tel':
82 ?>
83 <label for="description"><?php echo esc_html( $field['name'] ); ?></label>
84 <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'] ] ?? '' ); ?>">
85 <?php
86 break;
87 case 'textarea':
88 ?>
89 <label for="description"><?php echo esc_html( $field['name'] ); ?></label>
90 <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>
91 <?php
92 break;
93 case 'checkbox':
94 ?>
95 <label>
96 <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 ) : ''; ?>>
97 <?php echo esc_html( $field['name'] ); ?>
98 </label>
99 <?php
100 break;
101 }
102 ?>
103 </li>
104 <?php
105 }
106 }
107
108 // Social button.
109 $socials = learn_press_get_user_extra_profile_info( $user->get_id() );
110 if ( $socials ) {
111 foreach ( $socials as $k => $v ) {
112 if ( ! learn_press_is_social_profile( $k ) ) {
113 continue;
114 }
115 ?>
116
117 <li class="form-field form-field__profile-social form-field__50 form-field__<?php echo esc_attr( $k ); ?>">
118 <label for="description"><?php echo learn_press_social_profile_name( $k ); ?></label>
119 <div class="form-field-input">
120 <input type="text" value="<?php echo esc_attr( $v ); ?>" name="user_profile_social[<?php echo esc_attr( $k ); ?>]" placeholder="https://">
121 </div>
122 </li>
123 <?php
124 }
125 }
126 ?>
127
128 <?php do_action( 'learn-press/end-profile-basic-information-fields', $profile ); ?>
129 </ul>
130
131 <?php do_action( 'learn-press/after-profile-basic-information-fields', $profile ); ?>
132
133 <p>
134 <input type="hidden" name="save-profile-basic-information" value="<?php echo wp_create_nonce( 'learn-press-save-profile-basic-information' ); ?>"/>
135 </p>
136
137 <button type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button>
138
139 </form>
140