Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$wgExtensionFunctions[] = "relWebmention";
$wgExtensionCredits['parserhook'][] = array(
'name' => 'Rel Webmention',
'author' => 'Aaron Parecki',
'description' => 'Adds <nowiki><link rel="webmention"></nowiki> tag to advertise a Webmention endpoint on every page',
'url' => ''
function relWebmention()
global $wgHooks, $wgParser;
$wgHooks['OutputPageBeforeHTML'][] = 'RelWebmention::onOutputPageBeforeHTML';
class RelWebmention
public static function onOutputPageBeforeHTML(OutputPage &$out, &$text)
global $wgRequest, $wgWebmentionEndpoint, $wgPingbackEndpoint;
$out->addHeadItem('webmention', '<link rel="webmention" href="' . $wgWebmentionEndpoint . '">'."\n");
$out->addHeadItem('pingback', '<link rel="pingback" href="' . $wgPingbackEndpoint . '">'."\n");
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.