Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Implements hook_ENTITY_TYPE_create()
- */
- function MYMODULE_node_create(DrupalnodeNodeInterface $node) {
- if($node->bundle() == 'article') { //check for a content type, ex: article
- $user = DrupaluserEntityUser::load($uid); // load the user
- $user->set('field_name', $some_value); // set a value for a particular field
- $user->save();
- }
- }
Add Comment
Please, Sign In to add comment