You are here

function paragraphs_clone_node_alter in Paragraphs 7

Implements hook_clone_node_alter().

File

./paragraphs.node_clone.inc, line 11
Holds relevant functions for paragraph's node clone integration.

Code

function paragraphs_clone_node_alter(&$node, $context) {
  foreach (field_info_fields() as $field_name => $field) {
    if ($field['type'] == 'paragraphs' && isset($node->{$field_name})) {
      foreach ($node->{$field_name} as $field_language => $values) {
        paragraphs_clone_items('node', $node, $field_name, $field_language);
      }
    }
  }
}