Skip to content

Instantly share code, notes, and snippets.

@JustAnotherMark
Last active December 30, 2015 08:49
Show Gist options
  • Select an option

  • Save JustAnotherMark/7805495 to your computer and use it in GitHub Desktop.

Select an option

Save JustAnotherMark/7805495 to your computer and use it in GitHub Desktop.
How to disable 'in code' Views provided by contrib modules that you're never going to use and are just cluttering up the admin lists.
<?php
/**
* Implements hook_views_default_views_alter().
*
* Disables views provided by contrib modules that are unnecessary.
*/
function module_name_views_default_views_alter(&$views) {
// Disable the default 'tweets' view provided by the Twitter module.
if (isset($views['tweets'])) {
$views['tweets']->disabled = TRUE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment