function 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()
hook_init in drupal/core/modules/system/system.api.php
Perform setup tasks for non-cached page requests.
hook_menu_breadcrumb_alter in drupal/core/modules/system/system.api.php
Alter links in the active trail before it is rendered as the breadcrumb.
l in drupal/core/includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.
language_block_view in drupal/core/modules/language/language.module
Implements hook_block_view().
menu_get_active_breadcrumb in drupal/core/includes/menu.inc
Gets the breadcrumb for the current page, as determined by the active trail.

... See full list

File

drupal/core/includes/path.inc, line 18
Functions to handle paths in Drupal.

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() == config('system.site')
      ->get('page.front');
  }
  return $is_front_page;
}