Programmatically create blocks using hook_block
admin
15 April 2010
Drupal API provide a hook function hook_block that allow developers to create block or set of blocks their way. hook is a keyword that will replace by the module name, for example example.module file will implement this hook as example_block()
For further details about this hook please visit here