Commit 8d655b8c authored by drumm's avatar drumm
Browse files

#85062 by pwolanin. Update node type names for renamed content types in theme settings.

parent 3ee7ed6a
......@@ -2053,6 +2053,25 @@ function system_theme_settings($key = '') {
return system_settings_form($form);
}
/**
* Implementation of hook_node_type().
*
* Updates theme settings after a node type change.
*/
function system_node_type($op, $info) {
if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
$old = 'toggle_node_info_'. $info->old_type;
$new = 'toggle_node_info_'. $info->type;
$theme_settings = variable_get('theme_settings', array());
if (isset($theme_settings[$old])) {
$theme_settings[$new] = $theme_settings[$old];
unset($theme_settings[$old]);
variable_set('theme_settings', $theme_settings);
}
}
}
/**
* Output a confirmation form
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment