How do I pass an additional variable to function theme_item_list I need an additional variable to be available to the function theme_item_list. How do I correcly pass my variable so that I can alter the function like so:

function theme_item_list($variables) {
  $items = $variables['items'];
  $title = $variables['title'];
  $type = $variables['type'];
  $attributes = $variables['attributes'];
  $MY_VAR = $variables['MY_VAR'];


Here is my render array:

  $node-&gt;content['list'] = array(
    '#theme' =&gt; 'item_list',
    '#items' =&gt; $items,
    '#weight' =&gt; 2,
    '#prefix' =&gt; '&lt;div id="list"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
  );


Thanks
Implement hook_theme_registry_alter() to let Drupal know about the new var:

function MYTHEME_theme_registry_alter(&amp;$registry) {
  $registry['item_list']['variables']['MY_VAR'] = NULL;
}


Then override the theme function:

function MYTHEME_item_list($vars) {
  // Copy/change original theme_item_list as required.
  // $vars['MY_VAR'] is available as long as it has been passed in.
}


And just make sure you pass the var in your render array:

$node-&gt;content['list'] = array(
  '#theme' =&gt; 'item_list',
  '#items' =&gt; $items,
  '#weight' =&gt; 2,
  '#prefix' =&gt; '&lt;div id="list"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
  '#MY_VAR' =&gt; 'foo',
);