You are here

public function EmptyParagraphKiller::tips in Empty paragraph killer 8

Generates a filter's tip.

A filter's tips should be informative and to the point. Short tips are preferably one-liners.

@todo Split into getSummaryItem() and buildGuidelines().

Parameters

bool $long: Whether this callback should return a short tip to display in a form (FALSE), or whether a more elaborate filter tips should be returned for template_preprocess_filter_tips() (TRUE).

Return value

string|null Translated text to display as a tip, or NULL if this filter has no tip.

Overrides FilterBase::tips

File

src/Plugin/Filter/EmptyParagraphKiller.php, line 36

Class

EmptyParagraphKiller
Plugin annotation @Filter( id = "emptyparagraphkiller", title = @Translation("Empty Paragraph filter"), description = @Translation("When entering more than one carriage return, only the first will be honored."), type =…

Namespace

Drupal\emptyparagraphkiller\Plugin\Filter

Code

public function tips($long = FALSE) {
  if ($long) {
    return $this
      ->t("Your typing habits may include hitting the return key twice when completing a paragraph. This site will accommodate your habit, and ensure the content is in keeping with the the stylistic formatting of the site's theme.");
  }
  return $this
    ->t("Empty paragraph killer - multiple returns will not break the site's style.");
}