function variable_get

Returns a persistent variable.

Case-sensitivity of the variable_* functions depends on the database collation used. To avoid problems, always use lower case for persistent variable names.

Parameters

$name: The name of the variable to return.

$default: The default value to use if this variable has never been set.

Return value

The value of the variable. Unserialization is taken care of as necessary.

See also

variable_del()

variable_set()

112 calls to variable_get()
BlockTest::testHideBlockTitle in drupal/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
Test block title display settings.
BlockTestBase::setUp in drupal/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
Sets up a Drupal site for running functional and integration tests.
book_admin_paths in drupal/core/modules/book/book.module
Implements hook_admin_paths().
CascadingStylesheetsTest::testAddCssFileWithQueryString in drupal/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
Tests that CSS query string remains intact when added to file.
CascadingStylesheetsTest::testRenderFile in drupal/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
Tests rendering the stylesheets.

... See full list

1 string reference to 'variable_get'
system_test_menu in drupal/core/modules/system/tests/modules/system_test/system_test.module
Implements hook_menu().

File

drupal/core/includes/bootstrap.inc, line 897
Functions that need to be loaded on every Drupal request.

Code

function variable_get($name, $default = NULL) {
  global $conf;
  return isset($conf[$name]) ? $conf[$name] : $default;
}