← All changes
|
templates/profile/tabs/settings/basic-information.php
+106
-106
4.3.9
→
4.4.8
View file →
| @@ -1,106 +1,106 @@ | ||
| 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.1 | |
| 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 | - do_action( 'learn-press/profile/layout/general-info-custom', $profile ); | |
| 74 | - | |
| 75 | - // Social button. | |
| 76 | - $socials = learn_press_get_user_extra_profile_info( $user->get_id() ); | |
| 77 | - if ( $socials ) { | |
| 78 | - foreach ( $socials as $k => $v ) { | |
| 79 | - /*if ( ! learn_press_is_social_profile( $k ) ) { | |
| 80 | - continue; | |
| 81 | - }*/ | |
| 82 | - ?> | |
| 83 | - | |
| 84 | - <li class="form-field form-field__profile-social form-field__50 form-field__<?php echo esc_attr( $k ); ?>"> | |
| 85 | - <label for="description"><?php echo learn_press_social_profile_name( $k ); ?></label> | |
| 86 | - <div class="form-field-input"> | |
| 87 | - <input type="text" value="<?php echo esc_attr( $v ); ?>" name="user_profile_social[<?php echo esc_attr( $k ); ?>]" placeholder="https://"> | |
| 88 | - </div> | |
| 89 | - </li> | |
| 90 | - <?php | |
| 91 | - } | |
| 92 | - } | |
| 93 | - ?> | |
| 94 | - | |
| 95 | - <?php do_action( 'learn-press/end-profile-basic-information-fields', $profile ); ?> | |
| 96 | - </ul> | |
| 97 | - | |
| 98 | - <?php do_action( 'learn-press/after-profile-basic-information-fields', $profile ); ?> | |
| 99 | - | |
| 100 | - <p> | |
| 101 | - <input type="hidden" name="save-profile-basic-information" value="<?php echo wp_create_nonce( 'learn-press-save-profile-basic-information' ); ?>"/> | |
| 102 | - </p> | |
| 103 | - | |
| 104 | - <button class="lp-button" type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button> | |
| 105 | - | |
| 106 | -</form> | |
| 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.1 | |
| 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 | + do_action( 'learn-press/profile/layout/general-info-custom', $profile ); | |
| 74 | + | |
| 75 | + // Social button. | |
| 76 | + $socials = learn_press_get_user_extra_profile_info( $user->get_id() ); | |
| 77 | + if ( $socials ) { | |
| 78 | + foreach ( $socials as $k => $v ) { | |
| 79 | + /*if ( ! learn_press_is_social_profile( $k ) ) { | |
| 80 | + continue; | |
| 81 | + }*/ | |
| 82 | + ?> | |
| 83 | + | |
| 84 | + <li class="form-field form-field__profile-social form-field__50 form-field__<?php echo esc_attr( $k ); ?>"> | |
| 85 | + <label for="description"><?php echo learn_press_social_profile_name( $k ); ?></label> | |
| 86 | + <div class="form-field-input"> | |
| 87 | + <input type="text" value="<?php echo esc_attr( $v ); ?>" name="user_profile_social[<?php echo esc_attr( $k ); ?>]" placeholder="https://"> | |
| 88 | + </div> | |
| 89 | + </li> | |
| 90 | + <?php | |
| 91 | + } | |
| 92 | + } | |
| 93 | + ?> | |
| 94 | + | |
| 95 | + <?php do_action( 'learn-press/end-profile-basic-information-fields', $profile ); ?> | |
| 96 | + </ul> | |
| 97 | + | |
| 98 | + <?php do_action( 'learn-press/after-profile-basic-information-fields', $profile ); ?> | |
| 99 | + | |
| 100 | + <p> | |
| 101 | + <input type="hidden" name="save-profile-basic-information" value="<?php echo wp_create_nonce( 'learn-press-save-profile-basic-information' ); ?>"/> | |
| 102 | + </p> | |
| 103 | + | |
| 104 | + <button class="lp-button" type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button> | |
| 105 | + | |
| 106 | +</form> | |