How can I know if a type of content is moderated? I'm trying to find out if a type of content (not a node) is being moderated. How can I determine it?

For example:

function MY_MODULE_form_node_type_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
   $content_type = $form_state-&gt;getFormObject()-&gt;getEntity(); // $content_type is a Drupal\node\Entity\NodeType
}


I can't find a way to find out if this type of content is being moderated by some type of workflow.
You should be able to get that from ModerationInformation:: shouldModerateEntitiesOfBundle(), via the content_moderation.moderation_information service:

$moderation_info = \Drupal::service('content_moderation.moderation_information');
$entity_type = \Drupal::entityTypeManager()-&gt;getDefinition('node');
if ($moderation_info-&gt;shouldModerateEntitiesOfBundle($entity_type, $content_type-&gt;id())) {
  // ...
}