There are some wrong assumptions:
shs_json_term_get_children()
is not a hook, but a simple callback
- Even if it were a hook, implementing a similar hook doesn't override any other hook, except in the case of alter hooks, which are those hooks whose names end with
_alter
- Implementations of hooks are not named like
hook_shs_json_term_get_children_alter()
if hook is not the machine name of the module implementing it
As said in the answer for Is there any way to validate taxonomy terms? the module defines shs_json_term_get_children()
as callback using the following code.
$callbacks = array(
'shs_json_term_get_children' => array(
'callback' => 'shs_json_term_get_children',
'arguments' => array(
'vid' => 'is_numeric',
'parent' => 'is_array',
'settings' => 'is_array',
),
),
'shs_json_term_add' => array(
'callback' => 'shs_json_term_add',
'arguments' => array(
'vid' => 'is_numeric',
'parent' => 'is_numeric',
'name' => 'is_string',
),
),
);
// Let other modules add some more callbacks and alter the existing. (!)
drupal_alter('shs_json_callbacks', $callbacks);
So, if you need to completely override that callback (i.e. not rely on the values returned from that callback), you can implement code like the following.
function mymodule_json_callbacks(&$callbacks) {
$callbacks['shs_json_term_get_children']['callback'] = 'mymodule_json_term_get_children';
}
(Replace mymodule with the machine name of the module you are implementing.)
Your callback will receive the same arguments received from the original callback.
If, instead, you just want (for example) add a few terms to the ones returned from shs_json_term_get_children()
, or remove a few terms from the ones returned from that function, you implement hook_shs_term_get_children_alter()
.
function mymodule_shs_term_get_children_alter(&$terms, &$alter_options) {
// Alter $terms, or $alter_options.
}