Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Act on user meta updated, but only once

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:

  1. Difference Between Filter and Action Hooks?
  2. Post meta vs separate database tables
  3. How many times will this code run? (or, how rich is grandma?)
  4. Which hook should be used to add an action containing a redirect?
  5. add_action hook for completely new post?
  6. Add a new tab to WordPress Plugin install Listing
  7. Changing Plugin Load Order
  8. Admin settings update updating every time home page is hit?
  9. WordPress Hook for user register
  10. Global Objects and Public Methods
  11. Using filters and actions for plugin API?
  12. How should you hook a session_start() when authoring a plugin?
  13. Init action hook running late after PayPal’s return url?
  14. Is there widely accepted phpDoc syntax for documenting which hook calls a function?
  15. Explanation of the “posts_join” and “posts_fields” filter hooks?
  16. How do you use the plugin boilerplate loader class to hook actions and filters?
  17. How Do I Load My Action Earlier Enough?
  18. Does WP fire delete_post when trashed posts are automatically deleted?
  19. What’s the earliest point I can get the queried object ID?
  20. How do I Make a Theme “plugin-ready”?
  21. Why does do_action pass a blank string as the first parameter if no $arg is set?
  22. WordPress scheduled task is called but not executed
  23. Save metabox with multiple checkbox array
  24. How to add a link to WordPress Plugin install Listing
  25. How to modify post content before writing to database?
  26. I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
  27. Call activation hook multiple times
  28. How do I handle multiple Submit buttons in plugin’s option page?
  29. How to enable users to down-vote in this simple voting counter (that uses the post meta)?
  30. What’s the difference between hooks, filters and actions? [duplicate]
  31. How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
  32. Two-step login process – Is it possible?
  33. How to check if certain plugin exists and in expected version
  34. Plugin development, hooks, generate content
  35. Is it possible to create an action hook using do_action() within add_action()?
  36. How can I hook into existing WordPress Bulk actions?
  37. Hook for post permalink update
  38. Dynamically Override Fancy Title
  39. Get returned variable from a function to add_shortcode function
  40. Hook event for upload image in the menu
  41. Help with callback using do_action_ref_array
  42. How can I add a custom meta value on file upload?
  43. Earliest WP Hook to Safely and Reliably Redirect
  44. Define a function outside a class and call the function using action or filter hook
  45. How can I free up the memory used by update_post_meta?
  46. Is it possible to modify the media library admin screen?
  47. What function to hook for changes made in status and visibility of a post
  48. Create a plugin to change the action to which a function is hooked
  49. Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
  50. Synchronize Custom post type tags to WordPress default posts tags
  51. Is there a way to list tags order by post_meta field
  52. Adding Automatically To In WordPress Using Filter Referencing?
  53. Order of Operation for these three hooks
  54. comment_email hook doesn’t seem to work for comment editor field
  55. Best Practices for Creating and Handling Forms with Plugins?
  56. Is there a better way to implement responsive images than what WordPress uses by default?
  57. Modifying values with add_action to be sent to db
  58. Woocommerce – Hide a Column in Cart Table
  59. unable to stop loop when using wp_insert_post with publish_post hook
  60. save_post hook not triggered in WP v3.6.1
  61. Hook into theme-switching later than `setup_theme`
  62. Plugin development: get_post_meta is not working [closed]
  63. Add tab to profile.php wordpress plugin development
  64. Is it possible to delay execution of shortcode output callback?
  65. WordPress Ajax callback function from plugin – OOP
  66. Ordering posts by metadata
  67. Hook to get image filename when it is uploaded
  68. How to display a message about updates in the plugin list
  69. Why my database table not created on activation?
  70. How do I change the initial quantity of a product in woocommerce?
  71. How to delete an user including data from custom database tables
  72. Where and how does WordPress store and use its plugin and hook information?
  73. Is there any way to allow a plugin to write over a previous version?
  74. Which are the hooks run before/after when a category’s deletion?
  75. Should action callbacks start with a verb?
  76. Execute Hook on the footer or header after activating a plugin
  77. How to check if Woocommerce Order number equals to post ID?
  78. Why is my javascript not invoked in my hooks except wp_head?
  79. edit_{$taxonomy} | Hook
  80. WordPress after content Hook & external template part
  81. Namespaced action and filter tags
  82. What filter should I use to insert a button inside on Media>Add New
  83. best practice for query string values – get_query_var always empty for my value supplied in query string
  84. get_current_screen() return null
  85. update post meta for checkbox in the admin when inserted in the front-end
  86. Insert Multiple Post with Same Publish Button
  87. 403 Error when text is pasted in Custom Metabox Textarea
  88. Modifying meta tags after doing ajax call in plugin
  89. how to add custom functionality after woocommerce place order button
  90. .mo translation strings not loading in PHP scripts that handle AJAX calls
  91. How to use a hook to override an update_post_meta call in a plugin?
  92. External Authentication, session_tokens not destroyed on logout
  93. Where to add hooks in a class
  94. Trying to understand order and frequency of action hooks firing
  95. How to use output buffering in WordPress hooked functions?
  96. Conditional hook based on the core function that is calling it
  97. Adding option to Gallery shortcode
  98. Saving value of a selection option in comment form as comment meta
  99. how to execute a function only when i send an order to trash [closed]
  100. Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]
Categories plugin-development Tags hooks, plugin-development, post-meta
Comment form connection to Gravity Forms
Style first 3 posts differently with a container, then the rest of the posts [closed]

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress