Programmatically place blocks? I'm using Drupal 7.  Right now, I have a main-menu navigation and Language switcher that exists in my website header.  I placed them there by going to the CMS>Structure>Blocks and hten dragging the blocks into the header region.

How do I programmatically situate these block in the header?
To alter the region where blocks defined by other modules are placed, you can implement hook_block_info_alter(), which receives the following arguments:


$blocks (passed by reference): the array containing the block definitions, keyed by module, and delta
$theme: the theme for which the blocks are being defined
$code_blocks: the blocks as defined from the hook_block_info() implementations, before their values are overridden by the values obtained from the database