Skip to content
Snippets Groups Projects
Commit dce802fa authored by lucha's avatar lucha
Browse files

added copy-custom-css command

parent c92e382f
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,10 @@ Known commands:
wp-piwik-clear-config BLOG
Clear the configuration for wp-piwik plugin.
copy-custom-css BLOG
Copies the Custom CSS config to the standard Wordpress Customizer config,
then removes the old (options).
<?php
exit(1);
}
......@@ -594,6 +598,30 @@ function do_uninstall_plugin($args){
}
}
function do_copy_custom_css($args){
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "{$arg}: blog not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
$custom_css = get_option('custom-css');
if (!$custom_css){
$wp_css = wp_get_custom_css();
wp_update_custom_css_post($wp_css . "\n" . $custom_css);
delete_option('custom-css');
delete_option('custom_css_setting');
}
restore_current_blog();
}
}
// Command-line parsing.
$cmd = $argv[1];
if (!$cmd) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment