WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok guys, i have problem when using some trics from here or other sites. Im trying to use this method of adding custom user fields. But, when i add this, everytime i save its all ok, but when i come back to edit something different in user profile, those new fields just goes blank, and if i did not input again my data in those fields and save my profile, those fields goes blank in DB. So, something is not ok that need to show me what i did just saved.

As I told, it`s all ok until i open again my profile for editing.

Ok, here is code, http://pastebin.com/u9syYRF3

share|improve this question
@Саша: Can you update your question and add the code you're using to add the fields? This sounds like you just need to set the value of the new fields to the current DB value, if it exists. – Jan Fabry Dec 7 '10 at 12:20
Jan is right, you need to add more / clarify your question otherwise it's hard to understand for all those who don't know your site's code. – hakre Dec 7 '10 at 12:41
There, code pasted on pastebin. If you need to test what i told, i can make you an user on my blog. – Саша Стефановић Dec 7 '10 at 12:47
Jan has you covered, see answer... ;) – t31os Dec 7 '10 at 15:45
up vote 2 down vote accepted

You have specified the value of the <textarea> in a value attribute, but for a <textarea> you must put it between the two tags:

<textarea rows="10" cols="60" name="adsense_336" id="adsense_336" class="regular-text" ><?php echo esc_attr( get_the_author_meta( 'adsense_336', $user->ID ) ); ?></textarea>
share|improve this answer
You have a typo in the answer.... i believe the first textarea should be referring to input.. ;) – t31os Dec 7 '10 at 16:03
@t31os: Ah, it was a confusing sentence. Fixed it, thanks! – Jan Fabry Dec 7 '10 at 17:26
Oh, thanks ! I totaly missed what i want to do. Thanks again to both of you ! Working now like an charm ! – Саша Стефановић Dec 15 '10 at 12:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.