0

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.

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

        wp_editor($content, $editor_id);
        ?>
    </td>
</tr>

And for update:

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

Where am I wrong?

1 Answer 1

1

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

2
  • 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
    Commented Jan 4, 2016 at 10:33
  • You should not use any deprecated function like update_usermeta() @AliZia
    – Saikat
    Commented Jan 4, 2016 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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