This didn't seem to output the correct format for the OG meta tags due to the addMeta function called with the BeforePageDisplay hook. Could be my fault. For example, I am getting <meta name="property:og:type" content="article" />
when it should be <meta property="og:type" content="article"/>
. Unless there's something I'm missing, addMeta will only return <meta name="$value1" content="$value2"/>
formatted meta tags.
I am on MediaWiki 1.18.0, PHP 5.2.17, and MySQL 5.1.56--maybe the function addMeta has changed in the latest update? I corrected it by using the hook OutputPageBeforeHTML and the function addHeadItem to output:
foreach( $meta as $property => $value ) {
if ( $value ){
$out->addHeadItem( "OGMeta$i", '<meta property="'.$property.'" content="'.$value.'"/>'.PHP_EOL );
$i++;
}
It seems to work. Thoughts?
This post was posted by Peachey88 (Flood), but signed as Lost Student.