menu_get_active_trail() builds menu items and caches them for the remainder of the request. However, if it's called from hook_init(), the include-file with the title callback is not loaded yet, your callback isn't found and the cached trail will have an empty title for the menu item.
drupal_get_title() will later use the already-cached trail from menu_get_active_trail(), and output the empty title.
Comments
Comment #1
roderikTry the -dev version (as of may 12, 2015). This removes special_items_init(). This worked for me; may work for you too.
In my case, the empty title was caused by the combination of
menu_get_active_trail() builds menu items and caches them for the remainder of the request. However, if it's called from hook_init(), the include-file with the title callback is not loaded yet, your callback isn't found and the cached trail will have an empty title for the menu item.
drupal_get_title() will later use the already-cached trail from menu_get_active_trail(), and output the empty title.