WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/profile update

This page is marked as incomplete. You can help Codex by expanding it.

Description

This hook allows you to access data for a user immediately after their database information is updated. Two arguments are passed to functions using this hook: "user_id" (int) and "old_user_data" (object).

Note : This hook is not used on user edit/profile pages. To hook into the admin's user edit pages, use the hook edit_user_profile_update which is located in `/wp-includes/user-edit.php` instead.

Usage

<?php

    add_action( 'profile_update', 'my_profile_update', 10, 2 );

    function my_profile_update( $user_id, $old_user_data ) {
        // Do something
    }
?>

Parameters

$user_id
(integer) (optional) The user ID of the user being edited.
Default: None
$old_user_data
(object) (optional) The WP_User object of the user before it was edited.
Default: None

Location

This hook is located in `/wp-includes/user.php`

Related

Action Hooks

Filter Hooks

Return to Plugin API/Action Reference