$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();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)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘$changes array is empty’ is closed to new replies.