| 7 block.api.php | hook_block_save($delta = '', $edit = array()) |
| 8 block.api.php | hook_block_save($delta = '', $edit = array()) |
Save the configuration options from hook_block_configure().
This hook allows you to save the block-specific configuration settings defined within your hook_block_configure().
Parameters
$delta: Which block is being configured. This is a unique identifier for the block within the module, defined in hook_block_info().
$edit: The submitted form data from the configuration form.
For a detailed usage example, see block_example.module.
See also
Related topics
11 functions implement hook_block_save()
2 invocations of hook_block_save()
File
- modules/
block/ block.api.php, line 187 - Hooks provided by the Block module.
Code
function hook_block_save($delta = '', $edit = array()) {
// This example comes from node.module.
if ($delta == 'recent') {
variable_set('node_recent_block_count', $edit['node_recent_block_count']);
}
}
Login or register to post comments
Comments
Do I need variable_del?
When I don't need the the module.
Sure you do
Sure you do
<?php/**
* Implements hook_uninstall().
*/
function MODULE_uninstall() {
variable_del('node_recent_block_count');
}
?>
Check example in examples module