You are here

function hook_domain_source_path_alter in Domain Access 7.2

Same name and namespace in other branches
  1. 8 domain_source/domain_source.api.php \hook_domain_source_path_alter()
  2. 6.2 API.php \hook_domain_source_path_alter()
  3. 7.3 domain.api.php \hook_domain_source_path_alter()

Allows modules to specify the target link for a Drupal path.

Note: This hook is not meant to be used for node paths, which are handled by hook_domain_source_alter(). This hook is split from hook_domain_source_alter() for better performance.

Currently, no modules in the package implement this hook.

Parameters

&$source: The domain array from domain_get_node_match(), passed by reference.

$nid: The identifier of the obect being rewritten. For nodes, this is the node id. In other instances, we may pass a $path string or other variable.

Return value

No return value; modify $source by reference.

2 invocations of hook_domain_source_path_alter()
domain_get_path_match in ./domain.module
Allow the lookup of path rewrites.
domain_url_outbound_alter in ./settings_custom_url.inc
Implements hook_url_outbound_alter().

File

./domain.api.php, line 333
API documentation file.

Code

function hook_domain_source_path_alter(&$source, $path) {

  // Always make admin links go to the primary domain.
  $base = arg(0, $path);
  if ($base == 'admin') {
    $source = domain_default();
  }
}