Skip to content

Instantly share code, notes, and snippets.

@driesd
Created January 15, 2014 08:54
Show Gist options
  • Save driesd/8432922 to your computer and use it in GitHub Desktop.
Save driesd/8432922 to your computer and use it in GitHub Desktop.
Provides rel="nofollow" on specific menu links
<?php
/**
* Implements theme_preprocess_menu_link()
*/
function the_aim_theme_preprocess_menu_link(&$variables) {
$nofollowlinks = array(367);
$element = &$variables['element'];
if (in_array($element['#original_link']['mlid'], $nofollowlinks)) {
$element['#localized_options']['attributes']['rel'] = 'nofollow';
}
return theme_menu_link($variables);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment