You are here

function usermerge_invoke_all in User Merge 7.2

Invokes a hook in all enabled modules that implement it.

Replaces module_invoke_all() and bypasses the cache.

3 calls to usermerge_invoke_all()
usermerge_data_review_form in ./usermerge.module
Form that allows the selection of data to be merged.
usermerge_merge_accounts in ./usermerge.module
Merges the selected accounts.
usermerge_merge_form in ./usermerge.module
Form to collect the two user IDs.

File

./usermerge.module, line 446
Main file for the User Merge module.

Code

function usermerge_invoke_all($hook) {
  usermerge_load_includes();
  $args = func_get_args();

  // Remove $hook from the arguments.
  unset($args[0]);
  $return = array();
  foreach (usermerge_module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    if (function_exists($function)) {
      $result = call_user_func_array($function, $args);
      if (isset($result) && is_array($result)) {
        $return = array_merge_recursive($return, $result);
      }
      elseif (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}