You are here

public function UnpublishByKeywordComment::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php \Drupal\comment\Plugin\Action\UnpublishByKeywordComment::buildConfigurationForm()
  2. 9 core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php \Drupal\comment\Plugin\Action\UnpublishByKeywordComment::buildConfigurationForm()

File

core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php, line 100

Class

UnpublishByKeywordComment
Unpublishes a comment containing certain keywords.

Namespace

Drupal\comment\Plugin\Action

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form['keywords'] = [
    '#title' => $this
      ->t('Keywords'),
    '#type' => 'textarea',
    '#description' => $this
      ->t('The comment will be unpublished if it contains any of the phrases above. Use a case-sensitive, comma-separated list of phrases. Example: funny, bungee jumping, "Company, Inc."'),
    '#default_value' => Tags::implode($this->configuration['keywords']),
  ];
  return $form;
}