You are here

function social_content_cron in Social Content 7.2

Same name and namespace in other branches
  1. 7 social_content.module \social_content_cron()

Implements hook_cron().

Run through the social content types and import the posts. Delete old nodes.

File

./social_content.module, line 115
Social Content module.

Code

function social_content_cron() {
  set_time_limit(0);

  // Get all enabled instances.
  $instances = array_keys(SocialContent::getAllInstances(array(), TRUE));

  // Import.
  foreach ($instances as $id) {
    $instance = social_content_load($id);
    social_content_run_import($instance);
  }

  // Delete old nodes.
  social_content_delete_old_nodes();
}