It depends on what exact action you are using, and what the purpose of that action is.
For the update actions, for example, there should always be hooks that are triggered before doing the change (so that you may change or prevent it), and hooks that are triggered after the change has been completed (so that you can react to changes).
In your “user” case, if you want to compare the existing vs the changed user, you want to hook into the user_profile_update_errors
action. This action gives you an object that shows you what the intended changes are, and whether there’s already an existing user. In that case, you can retrieve the existing user through its ID and compare them both.
See: https://codex.wordpress.org/Plugin_API/Action_Reference/user_profile_update_errors
Related Posts:
- Restrict post edit/delete based on user ID and custom field
- Get updated post meta on save_post action?
- Job of meta_key meta_value fields in database tables
- Post IDs missing on delete_postmeta action hook
- Set default Custom Post Meta Value
- get_*_meta doesn’t always return an array
- Like & Dislike functionality using JavaScript
- wordpress is_front_page() issue
- Retrieve user_meta and copy to post_meta
- Array of user ids to list of user names
- get Insert id for meta field
- help to decipher wp metadata
- Check For get_post_meta on Author Archive Page
- show user based on user_meta
- How to call get_post()?
- Remove action of an external plugin after checking if custom post meta is set
- How can I get the post ID from a WP_Query loop?
- How to edit a post meta data in a Gutenberg Block?
- How we get_post_meta without post id
- What is the code to get the download link for a product in WooCommerce?
- Can I count the number of users matching a value in a multiple value key?
- Adding an assisting editor box to Post page
- Get Advanced Custom Fields values before saving [closed]
- Why am I getting an infinite loop with have_posts?
- How to store post meta in an array?
- get_post_meta / update_post_meta array
- update_post_meta() not working when used with WordPress action
- Get posts by meta value with date
- Delete post meta conditionally after save post
- Filter list by a unique meta value dilemma
- How to store Gutenberg ColourPicker RGBA as metadata
- Is it possible to update a post meta field through REST API if the format of it when registered is nested?
- Create a Metabox that behaves Like a Taxonomy Box
- Views count with time limit per IP
- Query 2 meta key values and a category
- trying to do if post meta !=0
- Trying to get file name
- how to build (custom) stats for post views, per month
- get_post_meta pagination
- Removing Post Meta from Category Pages?
- Hey, I want the second options. get_post_meta()
- Update post meta in woocommerce order frontend
- populate post meta in gravity forms [closed]
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- How to display post view count by date, week and month?
- How can I filter posts when the meta_value is a serialize object?
- Is there a way to append meta data without creating a race condition?
- Get User Post if Private
- How to receive all the meta information of a post ?
- add_post_meta adds meta to one more different post
- Unknown characters added to meta data values
- Compare old meta with new post meta
- get_post_meta($post->ID) returns empty string when in preview mode of custom post type
- need to add add user names to the post for later retrieval or removal
- Trying to get property of non-object error using get_post_meta()
- Custom Post type forgetting data
- update_post_meta not working in plugin
- get_permalink vs the_permalink
- Updating my Post when expiry date is past
- How to remove Date from Meta Description on SERP?
- How to display sql query fired by posts_where
- Unfiltered html with update_post_meta
- get meta value from page query
- why after saving meta value it’s saving all the values the one that i clicked?
- Update post meta within save_post action
- How does WordPress treats attachments metadata in post content?
- Stop `update_post_meta` from working each time page refreshes?
- How can I get some of a posts meta data whilst it is still inserting?
- Combining two meta_values within one row with query
- update_user_meta not updating
- Displaying the ‘time ago’ for recent activity within a post/custom post type?
- add post meta front end edit
- How to query and update one colum in postmeta table?
- How to remove date from showing in meta description
- How to save HTML data into SQL post_content column
- update post meta value with other post meta value
- Post Publish date not display on Umaya Child themes
- How to merge the database results into single result?
- Negative meta_query if storing multiple post_meta values with shared meta_key
- How can I update this array built from post meta data?
- What format is this and how to get value “lal” and “pila” from it
- Frontend query and does not need to log in [closed]
- Get data from custom table and update relative post_meta based on meta_key
- How to save a meta_value as a numeric value after I retrieve it via update_post_meta?
- Display multiple meta_key/meta_values by single SQL query
- Programatically delete several attributes in _product_attributes in post meta
- Adding user meta to post meta wp_insert_post() not working
- Get post meta after insert post
- Data not displaying in text field
- WP-API + JS Backbone client – how to update post meta
- Proper Way to Sanitize Meta Input
- update_post_meta returning false when called during init
- Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?
- Display a post count from a custom metabox selection
- Unsure how to add simple checkboxes that write to a small table to admin
- When importing posts to a new site if XML file has postmeta not setup on new server what happens?
- Access Serialized Post Meta Values
- Cache metadata for set of posts
- Does post-meta belong in header?
- Problem with get_post_meta