I need to put an id in menu links i have this code from here https://api.drupal.org/api/drupal/includes!menu.inc/function/theme_menu_link/7.
function theme_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
And have found the code i need but am struggling where to place it in the function. This code https://api.drupal.org/comment/45408#comment-45408:
l( t('Refresh Page'), $path . '/getdata', array(
'attributes' => array(
'id' => '',
'class' => 'btn-small btn-primary '
),'query' => drupal_get_destination() , 'html' => TRUE)),
);
Where would it go, i know what i need, but i am having difficulty doing it.
Thanks