You are here

function maxlength_update_2 in Maxlength 6.2

Same name and namespace in other branches
  1. 5.2 maxlength.install \maxlength_update_2()

Implementation of hook_update_N().

File

./maxlength.install, line 35
Install file for the maxlenght module

Code

function maxlength_update_2() {
  foreach (node_get_types() as $type => $name) {
    $code_old = 'maxlength_' . $type;
    $max_title = variable_get($code_old . '_t', '');
    $max_body = variable_get($code_old . '_b', '');
    variable_set('maxlength_title_' . $type, $max_title);
    variable_set('maxlength_body_' . $type, $max_body);
    variable_del($code_old . '_t');
    variable_del($code_old . '_b');
  }
  return array();
}