Skip to content

Instantly share code, notes, and snippets.

@steinmb
Created February 26, 2014 23:22
Show Gist options
  • Save steinmb/9240951 to your computer and use it in GitHub Desktop.
Save steinmb/9240951 to your computer and use it in GitHub Desktop.
hook_update_N() example moving blocks
<?php
/**
* Move system user-menu block from header to region-top.
*/
function elmcip_setup_update_7004() {
$num_updated = db_update('block')
->fields(array(
'region' => 'header_top',
'status' => 1,
'weight' => 1,
))
->condition('delta', 'user-menu')
->condition('theme', 'elmcip')
->execute();
print "Moved and enabled $num_updated block(s) to region header-top \n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment