1); } } /** * Implements hook_theme(). */ function metatag_google_plus_theme() { $info['metatag_google_plus'] = array( 'render element' => 'element', ); return $info; } /** * Theme callback for an Google+ meta tag. * * The format is: * */ function theme_metatag_google_plus($variables) { $element = &$variables['element']; // The format is e.g. 'itemprop:name'. Remove 'itemprop:' and store the rest // in '#itemprop'. $element['#itemprop'] = substr($element['#name'], 9); $args = array( '#itemprop' => 'itemprop', '#value' => 'content', ); element_set_attributes($element, $args); unset($element['#value']); return theme('html_tag', $variables); } /** * Implements hook_preprocess_html(). * * Add itemtype when available. * * Note: The $schemaorg variable must be added to the html tag of the * html.tpl.php template after the $rdf_namespaces variable, see README.txt * for details. */ function metatag_google_plus_preprocess_html(&$variables) { if (!isset($variables['schemaorg'])) { $variables['schemaorg'] = ''; } if (isset($variables['itemtype']) && !function_exists('zen_preprocess_html')) { $variables['schemaorg'] .= " itemscope itemtype=\"http://schema.org/{$variables['itemtype']}\""; } }