Last active
December 22, 2015 10:58
-
-
Save ccamara/6462267 to your computer and use it in GitHub Desktop.
How to rename a #variable in #drupal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Renames a function | |
*/ | |
function yourmodule_default_theme_settings() { | |
$new_variable_name = variable_get('old_variable_name', NULL); //Loads the variable to be renamed from drupal's variables table and assigns it to a new one. | |
variable_set('new_variable_name', $new_variable_name); //Stores $new_variable_name into drupal's variables table. | |
variable_del('old_variable_name'); //Deletes the old variable from drupal's variables table | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It can be also usefull to call this function from yourmodule's hook_install
and hook_update: