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

Add the "set-theme" command

parent 7368f6ec
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,9 @@ Known commands:
set-option OPTION_NAME OPTION_VALUE BLOG [...]
Set the value of an option for the specified blogs.
set-theme THEME_NAME BLOG [...]
Set the theme for the specified blogs.
print-all-blogs
Print a list of all existing blog IDs.
......@@ -189,6 +192,28 @@ function do_set_option($args) {
}
}
// 'set-theme': Set the theme of a blog.
function do_set_theme($args) {
$theme = array_shift($args);
if (!$theme) {
echo "Not enough arguments\n";
help();
}
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "Blog {$arg} not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
update_option('template', $theme);
update_option('stylesheet', $theme);
echo "{$arg}: {$theme}\n";
restore_current_blog();
}
}
// 'dump-shards': Print a JSON dictionary representing the full map
// of backend -> blogs database mappings.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment