function custom_block_load

Loads a custom block.

Parameters

int $id: The id of the custom block.

Return value

Drupal\custom_block\Plugin\Core\Entity\CustomBlock|false A CustomBlock object or FALSE if the requested $id does not exist.

3 calls to custom_block_load()
CustomBlockCreationTest::testBlockDelete in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
Test deleting a block.
CustomBlockSaveTest::testDeterminingChanges in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php
Tests determing changes in hook_block_presave().
CustomBlockSaveTest::testImport in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php
Checks whether custom block IDs are saved properly during an import.

File

drupal/core/modules/block/custom_block/custom_block.module, line 148
Allows the creaation of custom blocks through the user interface.

Code

function custom_block_load($id) {
  return entity_load('custom_block', $id);
}