Viewing 2 replies - 1 through 2 (of 2 total)
  • s1r0n

    (@s1r0n)

    Yes it is possible. I use the following function to email me on user_meta updates while I am debugging my custom site at https://www.thelightningpath.com/

    You have to play with this otherwise you could get a lot of actions, but this is the basic template.

    add_action('updated_user_meta','log_user_action',10,4);
    function log_user_action($meta_id='', $object_id='',$meta_key='', $meta_value='')    {
       global $current_user;
       if ($meta_value=='' || $meta_key =="last_viewed_8")
               return true;
    
       $message = sprintf("Changing <b>User,/b> %s <b>meta key</b>: %s <b>value:</b> %s",
               $current_user->user_nicename,
               $meta_key,
               $meta_value);
    
        wp_mail('[email protected]', "Changed meta data for user", $message);
    }

    Thread Starter rachelexodus

    (@rachelexodus)

    Thanks s1r0n! Not sure I’d know enough to be able to plug it into the API I need though… Which is why I’m hoping hookpress will add this action soon and I can use it with Zapier.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hook into Update User Meta’ is closed to new replies.