Created
September 18, 2014 09:13
-
-
Save johnennewdeeson/a2446f9e9bdd6f93bf80 to your computer and use it in GitHub Desktop.
Drupal disable a Views view programatically in an update hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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