Last active
March 31, 2021 07:21
-
-
Save cgi-caesar/4ce6393f17c49b8e4ef9d11d40b50564 to your computer and use it in GitHub Desktop.
aMember (site.php): Add Open Graph Meta to Login Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->blocks->add('login/form/before', new Am_Block_Base(null, 'og-login', null, function(Am_View $v) { | |
$meta = [ | |
'og:image' => '/path/to/image.png', | |
]; | |
$out = ''; | |
foreach ($meta as $property => $content) { | |
$out .= sprintf( | |
'<meta property="%s" content="%s" />%s', | |
Am_Html::escape($property), | |
Am_Html::escape($content), | |
"\n" | |
); | |
} | |
$v->placeholder("head-start")->append($out); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment