Skip to content

Instantly share code, notes, and snippets.

@johnennewdeeson
Created September 18, 2014 09:13
Show Gist options
  • Save johnennewdeeson/a2446f9e9bdd6f93bf80 to your computer and use it in GitHub Desktop.
Save johnennewdeeson/a2446f9e9bdd6f93bf80 to your computer and use it in GitHub Desktop.
Drupal disable a Views view programatically in an update hook
/**
* Disable the media browser view.
*/
function mymodule_update_7001() {
$view = views_get_view('media_default'); // media_default is the machine name of the view.
if (!empty($view)) {
ctools_include('export');
ctools_export_crud_set_status('views_view', $view, TRUE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment