Admin user edit – Grab newly submitted user meta immediately after update/submit

I suspect that the problem lies in the priority of the profile_update action.

You are using priority 10, which is also the default priority. The WP-Members plugin updates custom user meta fields using this same hook, also at the default priority. So, the plugin’s update is likely happening after your process. (This is probably why you are seeing “new” data when hitting update twice as well. The “new” data is no longer new at that point – It’s now the data that is saved for those fields.)

If you change the priority so that your action comes later you should see it updating (provided there aren’t issues with the rest of your function). Set it at 11 or higher for it to come after WP-Members updates data:

add_action ( 'profile_update', 'myplugin_admin_update', 11, 2 );

Leave a Comment