block_box_save
- Versions
- 4.6 – 5
block_box_save($edit, $delta = NULL)- 6
block_box_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: 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.
Code
modules/block/block.module, line 364
<?php
function block_box_save($edit, $delta) {
if (!filter_access($edit['format'])) {
$edit['format'] = FILTER_FORMAT_DEFAULT;
}
db_query("UPDATE {boxes} SET body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['body'], $edit['info'], $edit['format'], $delta);
return TRUE;
}
?>Login or register to post comments 