Skip to content

Instantly share code, notes, and snippets.

@vincenzo
Created March 15, 2012 10:49
Show Gist options
  • Save vincenzo/2043602 to your computer and use it in GitHub Desktop.
Save vincenzo/2043602 to your computer and use it in GitHub Desktop.
Programmatic CCK Content Type Updated - Step 4
<?php
function _example_cck_content_save_cck_node() {
module_load_include('inc', 'example_cck_content', 'example_cck_content.def');
$content = _example_cck_content_cck_export();
// we do not want too many modules enabled - the content_copy and
// alternate_content_copy modules are just needed in order to install the
// content type, so we just require them here (require_once prevent to
// include it more than once in case it is already enabled)
require_once './' . drupal_get_path('module', 'content') . '/modules/content_copy/content_copy.module';
require_once './' . drupal_get_path('module', 'alternate_content_copy') . '/alternate_content_copy.module';
alternate_content_copy_import_content($content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment