You are here

function hook_domainload in Domain Access 5

Same name and namespace in other branches
  1. 6.2 API.php \hook_domainload()
  2. 7.2 domain.api.php \hook_domainload()

Notifies other modules that we are loading a domain record from the database.

Modules may overwrite or add to the $domain array for each domain.

WARNING: If you need to make revisions to the $_domain global before it is processed by other modules, you must implement hook_init(). Only modules that implement hook_init() are loaded during the creation routine for the $_domain global. If your module has not been loaded, then hook_domainload() will skip your implementation.

When loading lists of domains or generating domain information, either use the proper functions -- domain_default(), domain_lookup(), and domain_domains() -- or invoke this hook.

Invoked by domain_lookup() and domain_default().

Parameters

&$domain: The current $domain array.

Return value

No return value. The $domain array is modified by reference..

Related topics

2 functions implement hook_domainload()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

domain_domainload in ./domain.module
Implement hook_domainload()
domain_user_domainload in domain_user/domain_user.module
Implement hook_domainload()
1 invocation of hook_domainload()
domain_api in ./domain.module
Helper function for passing hook_domainload() by reference.

File

./API.php, line 100
API documentation file.

Code

function hook_domainload(&$domain) {

  // Add a variable to the $domain array.
  $domain['myvar'] = 'mydomainvar';

  // Remove the site_grant flag, making it so users can't see content for 'all affiliates.'
  $domain['site_grant'] = FALSE;
}