You are here

function page_title_get_title in Page Title 6.2

Same name and namespace in other branches
  1. 8.2 page_title.module \page_title_get_title()
  2. 5.2 page_title.module \page_title_get_title()
  3. 6 page_title.module \page_title_get_title()
  4. 7.2 page_title.module \page_title_get_title()
  5. 7 page_title.module \page_title_get_title()

Simple wrapper function to get the currently set title for a page

Parameters

$raw: Optional parameter. If TRUE, the result will not be parsed with filter_xss.

Return value

string the title for the current page

1 call to page_title_get_title()
page_title_token_values in ./page_title.module
Implementation of hook_token_values().

File

./page_title.module, line 473
Enhanced control over the page title (in the head tag).

Code

function page_title_get_title($raw = FALSE, $flush = FALSE) {
  static $title = NULL;

  // This is used to internally "cache" the title in case we call the function more than once (which we shouldn't).
  if ($flush || is_null($title)) {

    // Give other modules the oppertunity to use hook_page_title_alter().
    drupal_alter('page_title', $title);
  }

  // Return the title in a safe form (any tags removed (such as emphasised or strong tags) and eny entiied encoded)
  return $raw ? $title : filter_xss($title, array());
}