user_profile_update_errors WordPress Action Hook

The user_profile_update_errors hook is used to receive notification when a user profile update has failed. It can be used to display an error message or take another action.

do_action_ref_array( 'user_profile_update_errors', WP_Error $errors, bool $update, stdClass $user ) #

Fires before user profile update errors are returned.


Parameters

$errors

(WP_Error)WP_Error object (passed by reference).

$update

(bool)Whether this is a user update.

$user

(stdClass)User object (passed by reference).


Top ↑

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.


Top ↑

Source

File: wp-admin/includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.