Until he does, you can do this work-around that I’m using.
I have a custom profile-form.php
in my theme folder that over-rides the profile-form.php
that is in the plugin folder. I don’t have a field for nickname, since we don’t use it. So, I guess that’s why I’m seeing this error.
So I took this bit of code from plugins/theme-my-login/templates/profile-form.php
(line 50-53):
<tr class="tml-nickname-wrap">
<th><label for="nickname"><?php _e( 'Nickname', 'theme-my-login' ); ?> <span class="description"><?php _e( '(required)', 'theme-my-login' ); ?></span></label></th>
<td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->nickname ); ?>" class="regular-text" /></td>
</tr>
And I put it somewhere in my custom profile-form.php
(it doesn’t really matter where). Then I changed it like this:
<tr style="display:none;" class="tml-nickname-wrap">
<th><label for="nickname"><?php _e( 'Nickname', 'theme-my-login' ); ?> <span class="description"><?php _e( '(required)', 'theme-my-login' ); ?></span></label></th>
<td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->first_name ); ?>" class="regular-text" /></td>
</tr>
See? I added style="display:none;"
to the <tr>
so that users won’t see any of this (that’s why it doesn’t matter where it goes). And I populated the field with $profileuser->first_name
instead of $profileuser->nickname
. You could do last_name
, or something else. They’re not going to see it so it doesn’t matter.
I hope that helps you. If so, just keep it in mind when Farthing does update the plugin to fix this problem. At that point we’ll both want to remove this from our custom profile-form.php
.
PS I also changed the table elements to divs.