You are here

function hook_userpoints_info in User Points 7

Same name and namespace in other branches
  1. 7.2 userpoints.api.php \hook_userpoints_info()

Return information about registered operations.

Modules can register operation strings

Return value

An array whose keys are operation strings used in userpoints_userpoints_api() and the which has the following properties:

  • description: A string that is used as a reason when transactions are displayed. Either this or a callback (see below) is required.
  • description callback: If the reason is dynamic, because he for example includes the title of a node, a callback function can be given which receives the transaction object and (if existing) and entity object as arguments.
  • admin description: A description which is searched for and displayed in the operation autocomplete field in the add points form.
1 function implements hook_userpoints_info()

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

userpoints_userpoints_info in ./userpoints.module
Implements hook_userpoints_info().
1 invocation of hook_userpoints_info()
userpoints_get_info in ./userpoints.module
Returns information about point-providing modules and operations.

File

./userpoints.api.php, line 26
API documentation for userpoints.module

Code

function hook_userpoints_info() {
  return array(
    'expiry' => array(
      'description' => t('!Points have expired.', userpoints_translation()),
      'admin description' => t('Expire an existing transaction'),
    ),
  );
}