Skip to content
Snippets Groups Projects
Commit cf5b5e2c authored by ale's avatar ale
Browse files

Add a theme-stats command

Prints usage counters for all themes.
parent c8a12e31
No related branches found
No related tags found
No related merge requests found
Pipeline #54234 passed
......@@ -186,6 +186,25 @@ function do_set_theme($args) {
}
}
// 'theme-stats': Prints statistics on theme usage for all local blogs.
function do_theme_stats($args) {
$counters = array();
foreach (noblogs_get_local_blog_objects() as $blog) {
switch_to_blog($blog->blog_id);
$theme = get_option('template');
if ($theme) {
if (in_array($theme, $counters)) {
$counters[$theme]++;
} else {
$counters[$theme] = 1;
}
}
}
foreach ($counters as $theme => $n) {
echo("{$theme} {$n}\n");
}
}
// 'dump-shards': Print a JSON dictionary representing the full map
// of backend -> blogs database mappings.
function do_dump_shards($args) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment