You are here

function nodewords_migrate_fields_node in Nodewords: D6 Meta Tags 6

Implementation of hook_migrate_fields_node().

Return value

An array of destination fields to be exposed to the Migrate content set for the passed content type.

1 call to nodewords_migrate_fields_node()
nodewords_migrate_prepare_node in ./nodewords.migrate.inc
Implementation of hook_migrate_prepare_node().

File

./nodewords.migrate.inc, line 35
Hooks for handling Migrate integration

Code

function nodewords_migrate_fields_node($type) {

  // Grab a list of all content types.
  $types = (array) content_types();

  // This will be the returned array of fields to expose.
  $fields = array();

  // Sanity checking: see if the passed content type exists.
  if (isset($types[$type])) {

    // Convenience variable.
    $content_type = $types[$type];

    // Check if nodewords is allowed for the content type.
    if (variable_get('nodewords_edit_metatags_' . $content_type, TRUE)) {

      // Need to elimate the 0 value entries.
      $tags = array_filter(variable_get('nodewords_edit', array()));
      foreach ($tags as $tag) {
        $fields['nodewords_' . $tag] = t('Nodewords: ' . ucfirst($tag));
      }
    }
  }
  return $fields;
}