do_action_ref_array( ‘user_profile_update_errors’, WP_Error $errors, bool $update, stdClass $user )

Fires before user profile update errors are returned.

Parameters

$errorsWP_Error
WP_Error object (passed by reference).
$updatebool
Whether this is a user update.
$userstdClass
User object (passed by reference).

More Information

This hook runs AFTER edit_user_profile_update and personal_options_update. If you want to validate some custom fields before saving, a workaround is to check the $errors array in this same callback, after performing your validations, and save the data if it is empty.

On return, if the errors object contains errors then the save is not completed & the errors displayed to the user.

Source

do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.