← All changes
|
templates/profile/tabs/settings/basic-information.php
+13
-46
4.1.7
→
4.4.8
View file →
| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * This template can be overridden by copying it to yourtheme/learnpress/settings/tabs/basic-information.php. |
| 6 | 6 | * |
| 7 | 7 | * @author ThimPress |
| 8 | 8 | * @package Learnpress/Templates |
| 9 | - * @version 4.0.0 | |
| 9 | + * @version 4.0.1 | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | defined( 'ABSPATH' ) || exit(); |
| 13 | 13 | |
| @@ -56,63 +56,30 @@ | ||
| 56 | 56 | |
| 57 | 57 | <li class="form-field form-field__bio form-field__clear"> |
| 58 | 58 | <label for="description"><?php esc_html_e( 'Biographical Info', 'learnpress' ); ?></label> |
| 59 | 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> | |
| 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 | + ?> | |
| 63 | 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> |
| 64 | 69 | </div> |
| 65 | 70 | </li> |
| 66 | 71 | |
| 67 | 72 | <?php |
| 68 | - $custom_profile = lp_get_user_custom_register_fields( $user->ID ); | |
| 69 | - $custom_fields = LP_Settings::instance()->get( 'register_profile_fields' ); | |
| 73 | + do_action( 'learn-press/profile/layout/general-info-custom', $profile ); | |
| 70 | 74 | |
| 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 | 75 | // Social button. |
| 109 | 76 | $socials = learn_press_get_user_extra_profile_info( $user->get_id() ); |
| 110 | 77 | if ( $socials ) { |
| 111 | 78 | foreach ( $socials as $k => $v ) { |
| 112 | - if ( ! learn_press_is_social_profile( $k ) ) { | |
| 79 | + /*if ( ! learn_press_is_social_profile( $k ) ) { | |
| 113 | 80 | continue; |
| 114 | - } | |
| 81 | + }*/ | |
| 115 | 82 | ?> |
| 116 | 83 | |
| 117 | 84 | <li class="form-field form-field__profile-social form-field__50 form-field__<?php echo esc_attr( $k ); ?>"> |
| 118 | 85 | <label for="description"><?php echo learn_press_social_profile_name( $k ); ?></label> |
| @@ -133,7 +100,7 @@ | ||
| 133 | 100 | <p> |
| 134 | 101 | <input type="hidden" name="save-profile-basic-information" value="<?php echo wp_create_nonce( 'learn-press-save-profile-basic-information' ); ?>"/> |
| 135 | 102 | </p> |
| 136 | 103 | |
| 137 | - <button type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button> | |
| 104 | + <button class="lp-button" type="submit" name="submit"><?php esc_html_e( 'Save changes', 'learnpress' ); ?></button> | |
| 138 | 105 | |
| 139 | 106 | </form> |