I'm looking for the hook that fires when a user's information are updated. Specifically, I want to update a post with the value of a custom profile field (in my example info
) everytime that user's profile is updated.
I tried the profile_update
hook, but it doesn't seem to fire:
add_action( 'profile_update', 'add_info_to_post' );
function add_info_to_post( $user_id ) {
$info=get_user_meta($user_id,'info',true);
//get all items of that user
$args=array(
'author' => $user_id,
'post_type' => 'item',
);
$items=get_posts($args);
foreach ($items as $item){
update_post_meta($item->ID,'user_info',$info);
}
}
Any suggestions how to make this work?
EDIT: Maybe I should mention that I access the users' profile pages through the backend..