Drupal - Get entity reference field value from node programmatically

Note Statistics

Note Statistics

  • Viewed 22 times
Wed, 07/21/2021 - 21:51

Example: Get tag IDs from a given node


  $getId = function ($item) {
    return $item['target_id'];
  };

  $tag_ids = array_map($getId, $node->field_tags->getValue());
Authored by