You are here

image_effects.api.php in Image Effects 8

Same filename and directory in other branches
  1. 8.3 image_effects.api.php
  2. 8.2 image_effects.api.php

API documentation for the Image Effects module.

File

image_effects.api.php
View source
<?php

/**
 * @file
 * API documentation for the Image Effects module.
 */
use Drupal\image\ConfigurableImageEffectBase;

/**
 * Alter the text of a Text Overlay effect before overlaying on the image.
 *
 * @param string $text
 *   The text string to be altered.
 * @param \Drupal\image\ConfigurableImageEffectBase $image_effect
 *   The Text Overlay image effect plugin for which text need to be altered.
 */
function hook_image_effects_text_overlay_text_alter(&$text, ConfigurableImageEffectBase $image_effect) {

  // Skip if the effect is not TextOverlayImageEffect or an alternative
  // implementation.
  if ($image_effect
    ->getPluginId() !== "image_effects_text_overlay") {
    return;
  }
  $text = 'my altered text';
}

Functions

Namesort descending Description
hook_image_effects_text_overlay_text_alter Alter the text of a Text Overlay effect before overlaying on the image.