I am making user meta fields. I have to implement a field named business_profile and implement editor on it. I have implemented the editor but I can't seem to either save its value or retrieve it. Below is my code.

        <label for="address">Business Profile</label></th>
        $content = get_the_author_meta('business_profile', $user->ID);
        $editor_id = 'mycustomeditor';

        wp_editor($content, $editor_id);

And for update:

update_usermeta($user_id, 'business_profile', $_POST['business_profile']);

Where am I wrong?


Might be because you are using a depreciated function for updating/adding the user meta (update_usermeta). You need to use update_user_meta function.

WP Codex: https://codex.wordpress.org/Function_Reference/update_user_meta

|improve this answer|||||
  • 1
    I changed my code to update_usermeta($user_id, 'business_profile', $_POST['mycustomeditor']); and it worked for me, but thankyou for your effort. – Ali Zia Jan 4 '16 at 10:33
  • You should not use any deprecated function like update_usermeta() @AliZia – Saikat Jan 4 '16 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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