vyatka

Drupal HEAD remove shortlink and generator

Aug 22nd, 2012
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. function themename_html_head_alter(&$head_elements) {
  2.   foreach ($head_elements as $key => $element) {
  3.     if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {
  4.       unset($head_elements[$key]);
  5.     }
  6.     if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'alternate') {
  7.       unset($head_elements[$key]);
  8.     }
  9.   }
  10.   unset($head_elements['system_meta_generator']);
  11.   $head_elements['system_meta_content_type']['#attributes'] = array(
  12.     'charset' => 'utf-8'
  13.   );
  14. }
Advertisement
Add Comment
Please, Sign In to add comment