Add User Info Fields
-
I would like to add some additional User Info Fields in the Profile window: UserPhone, UserStreetAddress. Before breaking a working WP installation with my minimal PHP knowledge, I thought I’d rather ask for some feedback;-)
What I intended doing is to simply add those 2 rows (user_phone and user_street) manually into the table wp-users at the end of the table via myPHPadmin.
Then, in profile.php I was going to add on line 97 the following 2 lines:
$newuser_phone=addslashes(stripslashes($_POST['newuser_phone']));
$newuser_street=addslashes(stripslashes($_POST['newuser_street']));
And on line 98 within the$query
I would adduser_phone='$newuser_phone'
anduser_street='$newuser_street'
.
Then, after line 173 I would add:
<?php _e('Phone:') ?> <?php echo $profiledata->user_phone ?>
<?php _e('Street:') ?> <?php echo $profiledata->user_street ?>
And then, after line 299 I would add:
<tr>
<th scope="row"><?php _e('Phone:') ?> </th>
<td> <input type="text" name="newuser_phone" id="newuser_phone2" value="<?php echo $profiledata->user_phone ?>" /> </td>
</tr>
<tr>
<th scope="row"><?php _e('Street:') ?> </th>
<td> <input type="text" name="newuser_street" id="newuser_street2" value="<?php echo $profiledata->user_street ?>" /> </td>
</tr>
I think this is what I would need to do within the profile.php. Is this correct? Thanks for any input.
- The topic ‘Add User Info Fields’ is closed to new replies.