Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using both wp_update_user() and update_user_meta() and I want to be able to check for an error, and if one occurs, output it to the user. Is this possible using something like $result = wp_update_user()? I don't want an integer though I want to read the text of the error.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Not really. Deep down such functions are essentially writes to database. So either database write fails (which doesn't produce meaningful message to return) or data is somehow wrong and function just returns false to escape.

Your best bet is probably to control data user inputs, not result of WP trying to process that data.

PS worth mentioning that for debug WP_DEBUG and wpdb error echoing rock, but it's not exactly what you are asking for.

share|improve this answer

Your Answer

 
discard

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.