How to display current pages the media entity is referenced during deletion? We are using Media Entity module that provides a Document media bundle. On our Article content type, we have created an Entity Reference field to Media that is set to Document media bundle. 

When you click Delete on this Document media entity, you are taken to a Are you sure you want to delete the media &lt;media name&gt;? page for confirmation (not sure of the official name, but let's call it Confirm Deletion page). On this page we would like to display all the pages where this media entity is currently being referenced. 

How would we display the list of nodes that are referencing the media that content editors are attempting to delete?
Additionally to the comment, here's the snippet we used based on the entity_usage module in a hook_form_alter():

  $object = $form_state-&gt;getFormObject();
  if ($object instanceof ContentEntityDeleteForm) {
    $entity = $object-&gt;getEntity();
    $usage_data = \Drupal::service('entity_usage.usage')-&gt;listSources($entity);

    if (!empty($usage_data)) {
      $count = 0;

      foreach ($usage_data as $usage) {
        $count += count($usage);
      }

      $form['usage_warning_message'] = [
        '#type' =&gt; 'container',
        '#markup' =&gt; t('This content is used in &lt;a href="@usage_url" target="_blank"&gt;@count&lt;/a&gt; places.', [
          '@usage_url' =&gt; Url::fromRoute('entity_usage.usage_list', [
            'entity_type' =&gt; $entity-&gt;getEntityTypeId(),
            'entity_id' =&gt; $entity-&gt;id(),
          ])-&gt;toString(),
          '@count' =&gt; $count,
        ]),
        '#attributes' =&gt; [
          'class' =&gt; ['messages', 'messages--warning'],
        ],
        '#weight' =&gt; -100,
      ];
    }
  }