You are here

function layout_builder_cron in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/layout_builder.module \layout_builder_cron()

Implements hook_cron().

File

core/modules/layout_builder/layout_builder.module, line 224
Provides hook implementations for Layout Builder.

Code

function layout_builder_cron() {
  if (\Drupal::moduleHandler()
    ->moduleExists('block_content')) {

    /** @var \Drupal\layout_builder\InlineBlockEntityOperations $entity_operations */
    $entity_operations = \Drupal::classResolver(InlineBlockEntityOperations::class);
    $entity_operations
      ->removeUnused();
  }
}