I have a node with user entity reference field. Now I want to get newly added users id's to this node via this field in hook_node_update

What is the best way?


The $node argument to hook_node_update contains a $node->original object. With that you can identify the newly added user IDs by comparing $node->your_user_ref_field to $node->original->your_user_ref_field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.