You are here

function hook_content_taxonomy_tree_callback_alter in Content Taxonomy 7

Alter the term tree callback that is used for content taxonomy options lists.

By default taxonomy_get_tree is used to retrieve the list of terms. It is important that any provided tree callback must have the same function signature as hook_content_taxonomy_tree_callback_alter(). For example this hook can be used to exchange the callback with a language specific tree function.

Parameters

$tree_callback: The current callback that can be overridden.

$field: The term reference field info array.

$vocabulary: The vocabulary object for which the term list should be retrieved. One field can have multiple vocabularies attached, which leads to multiple invocations of this function.

1 function implements hook_content_taxonomy_tree_callback_alter()

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

content_taxonomy_et_content_taxonomy_tree_callback_alter in ./content_taxonomy_et.module
Implements hook_content_taxonomy_tree_callback_alter().
1 invocation of hook_content_taxonomy_tree_callback_alter()
content_taxonomy_get_terms in ./content_taxonomy.module
Returns an array of terms that can be used in an options list.

File

./content_taxonomy.api.php, line 34
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_content_taxonomy_tree_callback_alter(&$tree_callback, $field, $vocabulary) {
  if ($vocabulary->machine_name == 'my_voc') {
    $tree_callback = 'my_tree_callback';
  }
}