| 5 path.inc | drupal_is_front_page() |
| 6 path.inc | drupal_is_front_page() |
| 7 path.inc | drupal_is_front_page() |
| 8 path.inc | drupal_is_front_page() |
Check if the current page is the front page.
Return value
Boolean value: TRUE if the current page is the front page; FALSE if otherwise.
10 calls to drupal_is_front_page()
File
- core/
includes/ path.inc, line 292 - Functions to handle paths in Drupal, including path aliasing.
Code
function drupal_is_front_page() {
// Use the advanced drupal_static() pattern, since this is called very often.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['is_front_page'] = &drupal_static(__FUNCTION__);
}
$is_front_page = &$drupal_static_fast['is_front_page'];
if (!isset($is_front_page)) {
$is_front_page = (current_path() == variable_get('site_frontpage', 'user'));
}
return $is_front_page;
}
Login or register to post comments