How to add Callback function for delete operation? I want to add a custom callback function for my delete operation.

$form['table'][$entity-&gt;id()] = [
        'title' =&gt; [
          '#type' =&gt; 'textfield',
          '#default_value' =&gt; $title,
        ],
        'status' =&gt; [
          '#type' =&gt; 'checkbox',
          '#default_value' =&gt; 1,
          '#disabled' =&gt; ($delta == 0),
        ],
        'weight' =&gt; [
          '#type' =&gt; 'weight',
          '#default_value' =&gt; $delta,
          '#attributes' =&gt; array('class' =&gt; array('mytable-order-weight')),
        ],
        'operations' =&gt; [
          '#type' =&gt; 'operations',
          '#links' =&gt; [
            'view' =&gt; [
              'title' =&gt; $this-&gt;t('View'),
              'url' =&gt; $entity-&gt;toUrl(),
            ],
            'edit' =&gt; [
              'title' =&gt; $this-&gt;t('Edit'),
              'url' =&gt; $entity-&gt;toUrl('edit-form'),
            ],
            'delete' =&gt; [
              'title' =&gt; $this-&gt;t('Delete'),
              // add callback function.
            ],
          ],
        ],
      ];


How do I do this?

What I tried so far was 

'delete' =&gt; [
              'title' =&gt; $this-&gt;t('Delete'),
              '#callback' =&gt; 'myDeleteFunction'
            ],
The operations are a list of links. If you want to delete a different entity see this example from the core workflows module how to build a delete link:

WorkflowStateEditForm::Form()

  $links['delete'] = [
    'title' =&gt; t('Delete'),
    'url' =&gt; Url::fromRoute('entity.workflow.delete_transition_form', [
      'workflow' =&gt; $workflow-&gt;id(),
      'workflow_transition' =&gt; $transition-&gt;id()
    ]),
  ];