If you can assume that user profile is edited all at once (Users Role, Organisation ID and Organisation name), you can hook on only one meta_key (say Organisation name) and send all infos at this moment. By the time this action is fired, all 3 metas are already in database.
add_action('updated_user_meta', 'when_user_meta_updated', 10, 3);
function when_user_meta_updated( $meta_id, $object_id, $meta_key, $_meta_value ) {
// we do this only on one meta not all three
if ($meta_key == 'organisation_name' ) {
$organisation_name = $_meta_value;
// get other fields from db
$user_role = get_user_meta( $object_id, 'user_role', true );
$organisation_ID = get_user_meta( $object_id, 'organisation_id', true );
// HTTP Call
}
}
Related Posts:
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- WordPress Hook for user register
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- What’s the earliest point I can get the queried object ID?
- How do I Make a Theme “plugin-ready”?
- WordPress scheduled task is called but not executed
- How to modify post content before writing to database?
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- How to check if certain plugin exists and in expected version
- Plugin development, hooks, generate content
- Is it possible to create an action hook using do_action() within add_action()?
- Hook event for upload image in the menu
- Help with callback using do_action_ref_array
- How can I free up the memory used by update_post_meta?
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- Best Practices for Creating and Handling Forms with Plugins?
- Is there a better way to implement responsive images than what WordPress uses by default?
- Modifying values with add_action to be sent to db
- Woocommerce – Hide a Column in Cart Table
- Plugin development: get_post_meta is not working [closed]
- Ordering posts by metadata
- Hook to get image filename when it is uploaded
- How to display a message about updates in the plugin list
- How to delete an user including data from custom database tables
- Is there any way to allow a plugin to write over a previous version?
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- How to check if Woocommerce Order number equals to post ID?
- Why is my javascript not invoked in my hooks except wp_head?
- Namespaced action and filter tags
- What filter should I use to insert a button inside on Media>Add New
- Insert Multiple Post with Same Publish Button
- 403 Error when text is pasted in Custom Metabox Textarea
- how to add custom functionality after woocommerce place order button
- How to use a hook to override an update_post_meta call in a plugin?
- External Authentication, session_tokens not destroyed on logout
- Saving value of a selection option in comment form as comment meta
- correct way to call javascript into hook function
- Add a Save Button to Custom Meta Box [duplicate]
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- Send push when new post is published in a certain category
- Run Shortcode of post’s custom field in functions.php / Plugin
- WordPress custom taxonomy check box to dropdown
- Force HTTPS 301 redirect with hook
- use of do_action() without any functions attached
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- How to get all queries’s results after they have executed?
- Plugin uninstall function is not working
- Remove an action by extending class and replacing it
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Bind a function with its own argument to show something dynamically after every content
- What’s the hook for filtering every texts of site?
- Hook add_attachment error
- Associate multiple email addresses with the same user account, so they can log in with either
- Update variable value via add_filter
- Custom filter not working
- hook update_option/updated_option empty $old_value and $value
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- Configure WordPress to Generate Scheme-less Relative URLs
- How to find list of all functions bind to a particular hook from my plugin?
- Using delete_post_meta for deleting multiple selected options
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Plugin can’t be activated [closed]
- Restrict certain actions to plugin-specific admin menu pages only
- Why is $_POST empty when saving custom Meta Box?
- How to enhance a self developed plugin by its own plugin architecture
- Condition to check previous next article post title
- How to update global variables in plugin activation callback?
- `registration_errors` filter doesn’t seem to be called
- How to grab data after wp user search is complete
- Insert, update or remove data from database (usermeta)
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- Hook for validating and rejecting frontend image upload
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Nested Hooks with do_action for performance reasons – safe/necessary?
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- remove different admin menu for specific users
- Add_action not calling callback function
- WordPress delete mysql rows with string
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- add_option_{$option} action hook not being called
- plugin modal/popup integration best practice
- Multi hook deploiement
- woocommerce single product page hook not working
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- What is the use of wp_schedule_event hook?
- Get user logged in status from within a plugin. $current_user not defined
- Insert plugin html content to a specific spot in the frontpage
- Send Webhook when post-status is publish or trash
- Using “add_image_size” to register custom image sizes inside plugins not working
- get_term_by() returning null on plugin
- wp_head is not fired from the hook I have used in my plugin
- A better way of getting draft posts that has a particular post meta using get_posts function