function block_custom_block_save

block_custom_block_save($edit, $delta)

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.

File

modules/block/block.module, line 566
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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!block!block.module/function/block_custom_block_save/7.x