function hook_privatemsg_autocomplete_alter

7-1 privatemsg.api.php hook_privatemsg_autocomplete_alter(&$matches, $names, $fragment)
7-2 privatemsg.api.php hook_privatemsg_autocomplete_alter(&$matches, $names, $fragment)
6-2 privatemsg.api.php hook_privatemsg_autocomplete_alter(&$matches, $names, $fragment)

Allows to alter the found autocomplete suggestions.


$matches: Array of matching recipient objects.

$names: Array of names that are already in the list.

$fragment: Fragment that is currently searched for.

Related topics

4 functions implement hook_privatemsg_autocomplete_alter()

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

pm_block_user_privatemsg_autocomplete_alter in pm_block_user/pm_block_user.module
pm_block_user_query_privatemsg_autocomplete_alter in pm_block_user/pm_block_user.module
Implements hook_query_TAG_alter().
privatemsg_filter_query_privatemsg_autocomplete_alter in privatemsg_filter/privatemsg_filter.module
Limit the user autocomplete for the filter widget.
privatemsg_realname_query_privatemsg_autocomplete_alter in privatemsg_realname/privatemsg_realname.module
Implements hook_query_privatemsg_autocomplete_alter().
1 invocation of hook_privatemsg_autocomplete_alter()
privatemsg_autocomplete in ./
Return autocomplete results for usernames.


./privatemsg.api.php, line 566
Privatemsg API Documentation


function hook_privatemsg_autocomplete_alter(&$matches, $names, $fragment) {
  // Remove all types other than user if accessed through
  // messages/user/autocomplete.
  if (arg(1) == 'user') {
    foreach ($matches as $id => $match) {
      if ($match->type != 'user') {