You are here

function hook_flag_definitions in Flag 6.2

Same name and namespace in other branches
  1. 7.2 flag.api.php \hook_flag_definitions()

Define one or more flag types.

Return value

An array whose keys are flag type names and whose values are properties of the flag type. Flag type names must match the content type (in the rest of Drupal: entity type) a flag type works with. Properties for flag types are as follows:

  • 'title': The main label of the flag type.
  • 'description': A longer description shown in the UI when creating a new flag.
  • 'handler': The name of the class implementing this flag type.

See also

flag_fetch_definition()

1 function implements hook_flag_definitions()

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

flag_flag_definitions in ./flag.inc
Implementation of hook_flag_definitions().
1 invocation of hook_flag_definitions()
flag_fetch_definition in ./flag.inc
Returns a flag definition.

File

./flag.api.php, line 29
Hooks provided by the Flag module.

Code

function hook_flag_definitions() {
  return array(
    'node' => array(
      'title' => t('Nodes'),
      'description' => t("Nodes are a Drupal site's primary content."),
      'handler' => 'flag_node',
    ),
  );
}