You are here

function privatemsg_invoke_privatemsg in Privatemsg 5.3

Same name and namespace in other branches
  1. 5 privatemsg.module \privatemsg_invoke_privatemsg()

Invoke a hook_privatemsg() operation in all modules.

Parameters

&$message: A message object.

$op: A string containing the name of the message operation.

Return value

The returned value of the invoked hooks.

5 calls to privatemsg_invoke_privatemsg()
privatemsg_new_form_submit in ./privatemsg.module
_privatemsg_delete in ./privatemsg.module
_privatemsg_new_preview in ./privatemsg.module
_privatemsg_prune in ./privatemsg.module
_privatemsg_view in ./privatemsg.module

File

./privatemsg.module, line 2447

Code

function privatemsg_invoke_privatemsg(&$message, $op) {
  $return = array();
  foreach (module_implements('privatemsg') as $name) {
    $function = $name . '_privatemsg';
    $result = $function($message, $op);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    else {
      if (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}