Skip to content

Instantly share code, notes, and snippets.

@KostasBlank
Created July 22, 2015 09:49
Show Gist options
  • Save KostasBlank/2ca32fdd25829ae3f2bf to your computer and use it in GitHub Desktop.
Save KostasBlank/2ca32fdd25829ae3f2bf to your computer and use it in GitHub Desktop.
Find all views with sql rewrite disabled
$all_views = views_get_all_views();
foreach ($all_views as $view) {
$displays = $view->display;
foreach ($displays as $views_display) {
$display_options = $views_display->display_options;
$disable_sql_rewrite = $display_options['query']['options']['disable_sql_rewrite'];
if ($disable_sql_rewrite) {
dpm($view->name . ': ' . $views_display->display_title);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment