You are here

function block_id_block_presave in Block ID 8

Same name and namespace in other branches
  1. 2.0.x block_id.module \block_id_block_presave()

Implements hook_ENTITY_TYPE_presave().

File

./block_id.module, line 17
Adding ID to blocks.

Code

function block_id_block_presave(BlockInterface $entity) {
  if (empty($entity
    ->getThirdPartySetting('block_id', 'id'))) {
    $entity
      ->unsetThirdPartySetting('block_id', 'id');
  }
}