function system_default_region

Same name in other branches
  1. 7.x modules/system/system.module \system_default_region()
  2. 9 core/modules/system/system.module \system_default_region()
  3. 8.9.x core/modules/system/system.module \system_default_region()
  4. 10 core/modules/system/system.module \system_default_region()

Gets the name of the default region for a given theme.

Parameters

$theme: The name of a theme.

Return value

string A string that is the region name.

2 calls to system_default_region()
BlockRebuildTest::testRebuildInvalidBlocks in core/modules/block/tests/src/Kernel/BlockRebuildTest.php
@covers ::block_rebuild
block_theme_initialize in core/modules/block/block.module
Assigns an initial, default set of blocks for a theme.

File

core/modules/system/system.module, line 909

Code

function system_default_region($theme) {
    $regions = array_keys(system_region_list($theme, REGIONS_VISIBLE));
    return $regions[0] ?? '';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.