Title: $changes array is empty
Last modified: April 30, 2024

---

# $changes array is empty

 *  Resolved [Tim Burkart](https://wordpress.org/support/users/bigmoxy/)
 * (@bigmoxy)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/changes-array-is-empty/)
 * I’m trying to write a hook but the $changes array appears to be empty. Is it 
   my code or is there a problem with the hook? The $user_id is present but nothing
   for $changes.
 * add_action( ‘um_after_user_account_updated’, ‘ikorcc_after_user_account_updated’,
   10, 2);
 * function ikorcc_after_user_account_updated( $user_id, $changes ){
   ob_start();
 *     ```wp-block-code
       echo "User ID: " . $user_id . "\nChanges:\n";
       foreach($changes as $key => $data) {
           echo $key . ': ' . (is_array($data) ? print_r($data, true) : $data) . "\n";
       }
   
       $contents = ob_get_contents();
       ob_end_clean();
   
       $admin_email = UM()->options()->get( 'admin_email' );
       wp_mail( $admin_email,'User Account Updated', $contents );
       ```
   
 * }

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * (@andrewshu)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/changes-array-is-empty/#post-17725593)
 * Hello [@bigmoxy](https://wordpress.org/support/users/bigmoxy/)
 * I think you code is wrong. Also, you could change the hook priority = 10 (try
   different).
 * Regards.
 *  Plugin Support [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * (@andrewshu)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/changes-array-is-empty/#post-17734924)
 * Hi [@bigmoxy](https://wordpress.org/support/users/bigmoxy/)
 * This thread has been inactive for a while so we’re going to go ahead and mark
   it Resolved.
 * Please feel free to re-open this thread if any other questions come up and we’d
   be happy to help. 🙂
 * Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘$changes array is empty’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/changes-array-is-empty/#post-17734924)
 * Status: resolved