Generate thumbnail in content text?

You could do something like this:

$oldFunction = kirbytext::$tags['image']['html'];
kirbytext::$tags['image'] = [
  'attr' => [...],
  'html' => function($tag) use($oldFunction) {
    $result = call($oldFunction, $tag);
    
    // extend the result with your own code
    // ...
    
    // return the new result
    return $result;
  }
];
3 Likes