function block_custom_block_save

Saves a user-created block in the database.

Parameters

$edit: Associative array of fields to save. Array keys:

  • info: Block description.
  • body: Associative array of body value and format. Array keys:
    • value: Block contents.
    • format: Filter ID of the filter format for the body.

$delta: Block ID of the block to save.

Return value

Always returns TRUE.

1 call to block_custom_block_save()
block_block_save in drupal/core/modules/block/block.module
Implements hook_block_save().

File

drupal/core/modules/block/block.module, line 583
Controls the visual building blocks a page is constructed with.

Code

function block_custom_block_save($edit, $delta) {
  db_update('block_custom')
    ->fields(array(
    'body' => $edit['body']['value'],
    'info' => $edit['info'],
    'format' => $edit['body']['format'],
  ))
    ->condition('bid', $delta)
    ->execute();
  return TRUE;
}