WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress 3.3, update_user_meta and wp_users/wp_usermeta issue (14 posts)

  1. Cornel_
    Member
    Posted 2 years ago #

    Hi everybody. Tried to find this in forums, but no luck.

    In WP 3.3, I have noticed an issue: in the profile page, I write the website in the url field. When I press Update it should update the data in the database and to show the new value in the field. It doesn't show up. From the back end, I tried also to modify the url, and it works. It shows also in the front end when the value is inserted from back end.

    Did some investigation, looks like when inserting from back end, the url goes in wp_users, meta_key is user_url. When inserting from front end, it goes in wp_usermeta, meta_key is user_url. Have no clue why..

    How is this possible, using the native WP functions ( update_user_meta() )? Also, into consideration, in WP 3.2, the same code works fine, and both, front end and back end changes are made in wp_usermeta.

    Any help, ideas, opinions are highly appreciated. Thank you.

  2. lerizzle
    Member
    Posted 2 years ago #

    I have noticed the same. did you find a workaround?

  3. Cornel_
    Member
    Posted 2 years ago #

    Hi. Not yet. Thought maybe something wrong in the code. But can't find anything wrong. Do you use get_user_meta() to show the user fields?

  4. lerizzle
    Member
    Posted 2 years ago #

    Not showing just yet. trying to figure out why it's not inserting properly.

  5. Cornel_
    Member
    Posted 2 years ago #

    The front end uses update_user_meta() to update the field. If I use the_author_meta to retrieve the user_url, it shows me the value inserted from back end. If I use get_user_meta() for the usr_url, it shows me the value inserted from front end.

  6. lerizzle
    Member
    Posted 2 years ago #

    figured it out for me.

    I was using update_user_meta on the front end. You have to use

    wp_update_user( array ('ID' => $user_id, 'user_url' => 'http://www.site.com' ) ) ;
  7. lerizzle
    Member
    Posted 2 years ago #

    and to get the value in 3.3

    global $current_user;
    echo ( $current_user->__get( 'user_url' ) );

  8. amandafrench
    Member
    Posted 2 years ago #

    I'm having trouble with this, too. Is it definitely a problem with WP 3.3? I couldn't find a ticket for it in trac.

  9. ryscript
    Member
    Posted 2 years ago #

    same problem here, any one got a great solution for this?

  10. lerizzle
    Member
    Posted 2 years ago #

    yes code monkey use wp_update_user to add the user_url.

  11. Cornel_
    Member
    Posted 2 years ago #

    Thank you, lerizzle. It really works. This is for WP 3.3 only?

  12. ace90
    Member
    Posted 1 year ago #

    hi! everyone. when you use wp_update_user function, did you meet this error (Warning: Cannot modify header information - headers already sent by (output started at C:themes\twentyten\header.php:14) in C:\wp-includes\pluggable.php on line 720)? I'm new using wordpress. Please help me.

  13. ace90
    Member
    Posted 1 year ago #

    How can i rid this?

    thanks in advance

  14. ryscript
    Member
    Posted 1 year ago #

    Hi @ace90 there are lot possible solution in your problem and we didn't know which file you've updated or edited but this is just a case.

    Check your wp-config.php, just make sure there are no space at the beginning "<?php" and end of the file "?>", no quote.

    or check your index.php and header.php.

    hope that helps,

Topic Closed

This topic has been closed to new replies.

About this Topic