PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.0
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.0
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 / inc / admin / views / backend-user-profile.php

backend-user-profile.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.0, at inc/admin/views/backend-user-profile.php

87 lines 2.1 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 extra info in backend user profile.
4 *
5 * @author ThimPress
6 * @package LearnPress/Views
7 * @version 4.0.3
8 */
9
10 use LearnPress\Helpers\Template;
11 use LearnPress\Models\UserModel;
12
13 defined( 'ABSPATH' ) || die;
14
15 /**
16 * @var WP_User $user
17 */
18 if ( empty( $user ) ) {
19 return;
20 }
21
22 $extra_profile_fields = learn_press_social_profiles();
23 $extra_profile = learn_press_get_user_extra_profile_info( $user->ID );
24
25 $custom_profile = lp_get_user_custom_register_fields( $user->ID );
26 $userModel = new UserModel( $user->data );
27 $lp_message = LP_Request::get_param( 'lp-message' );
28 ?>
29
30 <h3><?php esc_html_e( 'LearnPress User Profile', 'learnpress' ); ?></h3>
31
32 <table class="form-table">
33 <tbody>
34 <?php
35 do_action( 'learn-press/admin/user/layout/general-info-custom', $user, $custom_profile );
36
37 if ( current_user_can( 'edit_users' ) ) {
38 ?>
39 <tr>
40 <th>
41 <label>
42 <?php esc_html_e( 'LP slug user name', 'learnpress' ); ?>
43 </label>
44 </th>
45 <td>
46 <input class="regular-text"
47 type="text"
48 value="<?php echo esc_attr( $userModel->get_slug_link() ); ?>"
49 name="lp_user_slug">
50 <?php
51 if ( ! empty( $lp_message ) ) {
52 Template::print_message( $lp_message, 'error' );
53 }
54 ?>
55 <p class="description">
56 <?php
57 printf(
58 '%s',
59 esc_html__( 'Custom slug to replace the WP login username, use for link lp profile/instructor. Must be unique.', 'learnpress' )
60 );
61 ?>
62 </p>
63 </td>
64 </tr>
65 <?php
66 }
67
68 foreach ( $extra_profile_fields as $key => $label ) {
69 $type = apply_filters( 'learn-press/extra-profile-field-type', 'text' );
70 ?>
71 <tr>
72 <th>
73 <label for="learn-press-user-profile-<?php echo esc_attr( $key ); ?>">
74 <?php echo esc_html( $label ); ?>
75 </label>
76 </th>
77 <td>
78 <input id="learn-press-user-profile-<?php echo esc_attr( $key ); ?>"
79 class="regular-text" type="<?php echo esc_attr( $type ); ?>"
80 value="<?php echo esc_attr( $extra_profile[ $key ] ?? '' ); ?>"
81 name="_lp_extra_info[<?php echo esc_attr( $key ); ?>]">
82 </td>
83 </tr>
84 <?php } ?>
85 </tbody>
86 </table>
87