Last active
November 2, 2019 02:00
-
-
Save robdecker/df9ce7ea76d5af8d4db7 to your computer and use it in GitHub Desktop.
[List all views and their displays] #d7
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
function MODULE_get_views_names() { | |
$views = views_get_all_views(); | |
$views_info = array(); | |
foreach ($views as $machine_name => $view) { | |
$views_info[$machine_name] = array(); | |
foreach ($view->display as $display_name => $display) { | |
$views_info[$machine_name][] = $display_name; | |
} | |
} | |
// Print array keyed by views machine name | |
dpm($views_info); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment