You are here

function tweet_feed_uninstall in Tweet Feed 7.2

Same name and namespace in other branches
  1. 8.3 tweet_feed.install \tweet_feed_uninstall()
  2. 6 tweet_feed.install \tweet_feed_uninstall()
  3. 7.3 tweet_feed.install \tweet_feed_uninstall()
  4. 7 tweet_feed.install \tweet_feed_uninstall()
  5. 4.x tweet_feed.install \tweet_feed_uninstall()

Implements hook_uninstall(). http://drupal.stackexchange.com/questions/88207/how-to-delete-content-ty...

File

./tweet_feed.install, line 157

Code

function tweet_feed_uninstall() {

  // The schema tables will be deleted by Drupal. We need to disable the feature and
  // remove the node contents and content types here.
  if (module_exists('tweet_feed_types')) {
    module_disable(array(
      'tweet_feed_types',
    ), FALSE);
  }
  drupal_uninstall_modules(array(
    'tweet_feed_types',
  ), FALSE);
  $content_types = array(
    'twitter_tweet_feed',
    'twitter_user_profile',
  );

  // Loop through each and delete the content type.
  foreach ($content_types as $ctype) {
    db_query("UPDATE {node_type} SET `custom` = 1, `locked` = 0 \n              WHERE `type` = :ctype", array(
      ':ctype' => $ctype,
    ));
  }
}