Skip to content

Instantly share code, notes, and snippets.

@balintbrews
Last active August 29, 2015 13:58
Show Gist options
  • Save balintbrews/10106819 to your computer and use it in GitHub Desktop.
Save balintbrews/10106819 to your computer and use it in GitHub Desktop.
Snippet to see what content types are used by your views in your Drupal site. Create a file with this content, then execute it with `drush php-script`.
<?php
$rows = array();
foreach (views_get_enabled_views() as $view) {
if ($view->base_table == 'node') {
foreach ($view->display as $display) {
if (isset($display->display_options['filters']['type'])) {
$rows[] = array(
sprintf('%s (%s)', $view->human_name, $view->name),
$display->display_title,
implode(',', array_keys($display->display_options['filters']['type']['value']))
);
}
}
}
}
drush_print_table($rows);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment