Trying to pass icon into the menu I am trying to use the icon API to pass an icon to the menu - I would use the icon menu module, but I want the icon to switch based on programmatic logic.

Here's what I have so far:

/**
 * Implements hook_menu().
 */
function MYMODULE_menu() {
  global $user;
  $icon = theme('icon', array('bundle' =&gt; "fontawesome", 'icon' =&gt; "envelope"));
  $items = array();
  $items['user/' . $user-&gt;uid . '/messages'] = array(
    'access callback' =&gt; 'user_is_logged_in',
    'title callback' =&gt; FALSE,
    'type' =&gt; MENU_NORMAL_ITEM,
    'menu_name' =&gt; 'main-menu',
    'title' =&gt; $icon . t('Messages'),
    'page callback' =&gt; 'views_embed_view',
    'page arguments' =&gt; array('message_private', 'page_1'),
    'file path' =&gt; drupal_get_path('module', 'views'),
    'file' =&gt; 'views.module',
        'options' =&gt; array('attributes' =&gt; array(
       'html' =&gt; true 
       )),
  );
  return $items;
}


However this just seems to get the escaped icon HTML in the menu.

How do I get the actual item from the icon API?

Is there some way to tell hook_menu to pass everything as it is?
by hook_menu you are just registering a path to Drupal. 


  Define menu items and page callbacks.


To get this printed with icon you can try contributed modules like 


Menu Icons
Icon API


Icon API module is able to apply your programmatic logic