# learnpress/4.1.7.1/inc/admin/views/backend-user-profile.php

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.1.7.1. 87 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.1.7.1/code/inc/admin/views/backend-user-profile.php
- Raw: https://pluginprobe.com/plugins/learnpress/4.1.7.1/raw/inc/admin/views/backend-user-profile.php
- Modified: 2022-09-15T05:24:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.1.7.1/code/inc/admin/views/backend-user-profile.php#L10-L20`.

```php
<?php
/**
 * Template for displaying extra info in backend user profile.
 *
 * @author  ThimPress
 * @package LearnPress/Views
 * @version 4.0.0
 */

defined( 'ABSPATH' ) || die;

/**
 * @var WP_User $user
 */

if ( empty( $user ) ) {
	return;
}

$extra_profile_fields = learn_press_get_user_extra_profile_fields();
$extra_profile        = learn_press_get_user_extra_profile_info( $user->ID );

$custom_profile = lp_get_user_custom_register_fields( $user->ID );
?>

<h3><?php esc_html_e( 'LearnPress User Profile', 'learnpress' ); ?></h3>

<table class="form-table">
	<tbody>
		<?php
		$custom_fields = LP_Settings::instance()->get( 'register_profile_fields' );

		if ( $custom_fields ) {
			foreach ( $custom_fields as $field ) {
				?>
				<tr>
					<th>
						<label for="learn-press-custom-register-<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ); ?></label>
					</th>
					<td>
					<?php
					switch ( $field['type'] ) {
						case 'text':
						case 'number':
						case 'email':
						case 'url':
						case 'tel':
							?>
							<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'] ] ?? '' ); ?>">
							<?php
							break;
						case 'textarea':
							?>
							<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>
							<?php
							break;
						case 'checkbox':
							?>
							<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 ) : ''; ?>>
							<?php
							break;
					}
					?>
					</td>
				</tr>
				<?php
			}
		}

		foreach ( $extra_profile_fields as $key => $label ) {
			$type = apply_filters( 'learn-press/extra-profile-field-type', 'text' );
			?>
			<tr>
				<th>
					<label for="learn-press-user-profile-<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $label ); ?></label>
				</th>
				<td>
					<input id="learn-press-user-profile-<?php echo esc_attr( $key ); ?>"
						class="regular-text" type="<?php echo esc_attr( $type ); ?>"
						value="<?php echo esc_attr( $extra_profile[ $key ] ?? '' ); ?>"
						name="_lp_extra_info[<?php echo esc_attr( $key ); ?>]">
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>

```
