You won't find a hook for running PHP during rendering, but there's a phpBB event for modifying the HTML after rendering.
What I would do is add a tag filter after
the normal validation (you know the tag is valid at this point) to scrape the OGP data and add it to the tag in serialized form. Your OGP data will end up stored along with the parsed text. That's for the scraping part. For the custom HTML, what I would do is add the serialized OGP data to the link
and post-process the HTML after rendering (using
) to replace the link with your custom HTML.
Configure the tag using
Code: Select all
$tag = $event['configurator']->tags['URL'];
$dom = $tag->template->asDOM();
public static function doTag($tag)
$url = $tag->getAttribute('url');
$ogp = ;