Same name and namespace in other branches
  1. 4.6.x includes/common.inc \drupal_get_path()
  2. 4.7.x includes/common.inc \drupal_get_path()
  3. 5.x includes/common.inc \drupal_get_path()
  4. 6.x includes/common.inc \drupal_get_path()
  5. 8.9.x core/includes/bootstrap.inc \drupal_get_path()
  6. 9 core/includes/bootstrap.inc \drupal_get_path()

Returns the path to a system item (module, theme, etc.).

Parameters

$type: The type of the item (i.e. theme, theme_engine, module, profile).

$name: The name of the item for which the path is requested.

Return value

The path to the requested item or an empty string if the item is not found.

182 calls to drupal_get_path()
AggregatorTestCase::getAtomSample in modules/aggregator/aggregator.test
AggregatorTestCase::getHtmlEntitiesSample in modules/aggregator/aggregator.test
AggregatorTestCase::getNoTitleSample in modules/aggregator/aggregator.test
AggregatorTestCase::getRSS091Sample in modules/aggregator/aggregator.test
AggregatorUpdatePathTestCase::setUp in modules/simpletest/tests/upgrade/update.aggregator.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.

... See full list

1 string reference to 'drupal_get_path'
module_load_include in includes/module.inc
Loads a module include file.

File

includes/common.inc, line 2969
Common functions that many Drupal modules will need to reference.

Code

function drupal_get_path($type, $name) {
  return dirname(drupal_get_filename($type, $name));
}