1 layout.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(). Most settings will automatically be saved if using the Layout module to position blocks, but if your settings should be site-wide or saved in the database instead of the Layout configuration, you may use this hook to save your settings. If you wish Layout module to *not* save your settings, unset the value from the $edit array.

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. This is passed by reference, so values can be changed or removed before they are saved into the layout configuration.

See also

hook_block_configure()

hook_block_info()

Related topics

File

core/modules/layout/layout.api.php, line 492
Describe hooks provided by the Layout module.

Code

function hook_block_save($delta, &$edit = array()) {
  if ($delta == 'my_block_delta') {
    config_set('mymodule.settings', 'my_global_value', $edit['my_global_value']);
    // Remove the value so it is not saved by Layout module.
    unset($edit['my_global_value']);
  }
}