Skip to content

Instantly share code, notes, and snippets.

@wizonesolutions
Created November 25, 2014 21:54
Show Gist options
  • Save wizonesolutions/178c7a9be28563044888 to your computer and use it in GitHub Desktop.
Save wizonesolutions/178c7a9be28563044888 to your computer and use it in GitHub Desktop.
<?php
$field_collections = array(); // <--- change to your array of field collection data
// Time to save field_collection_item entities.
foreach ($field_collections as $field_collection_name => $field_collection_entries) {
foreach ($field_collection_entries as $delta => $field_collection) {
// Everything should be in place from before. Just save it.
$field_collection->save(TRUE);
}
}
node_save($node);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment