0

In a custom plugin, I want to save user interface settings (e.g. which sections are expanded/hidden).

From what I see, the get_user_option (docs here) function is perfect for retrieving the value.

However, I don't think there is an add_user_option or set_user_option function like I would have expected (following the logic of non-user-specific options).

Thus the question: what is the equivalent of get_user_option for saving options?

Is it update_user_option (docs here)?

1 Answer 1

0

You can use update_user_option to update user options. Read more here: https://developer.wordpress.org/reference/functions/update_user_option/

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.