menu_get_active_title
- Versions
- 4.6 – 7
menu_get_active_title()
Get the title of the current page, as determined by the active trail.
Related topics
Code
includes/menu.inc, line 1625
<?php
function menu_get_active_title() {
$active_trail = menu_get_active_trail();
foreach (array_reverse($active_trail) as $item) {
if (!(bool)($item['type'] & MENU_IS_LOCAL_TASK)) {
return $item['title'];
}
}
}
?>Login or register to post comments 
Return value is unsanitized HTML
Beware: the return value of this function is interpreted as HTML. If you are printing the result of this function in your code or theme, you must escape them with check_plain or use the correct placeholder in t(). If you don't, users can execute a cross site scripting attack against your site.
<?php
// Incorrect:
print menu_get_active_title();
// Correct:
print check_plain(menu_get_active_trail());
?>