Inicio › API reference ›
hook_user_operations
hooks/core.php, line 2031
- Versions
- hooks
hook_user_operations()
Add mass user operations.
This hook enables modules to inject custom operations into the mass operations dropdown found at admin/user/user, by associating a callback function with the operation, which is called when the form is submitted. The callback function receives one initial argument, which is an array of the checked users.
Valor de retorno
An array of operations. Each operation is an associative array that may contain the following key-value pairs:
- "label": Required. The label for the operation, displayed in the dropdown menu.
- "callback": Required. The function to call for the operation.
- "callback arguments": Optional. An array of additional arguments to pass to the callback function.
Código
<?php
function hook_user_operations() {
$operations = array(
'unblock' => array(
'label' => t('Unblock the selected users'),
'callback' => 'user_user_operations_unblock',
),
'block' => array(
'label' => t('Block the selected users'),
'callback' => 'user_user_operations_block',
),
'delete' => array(
'label' => t('Delete the selected users'),
),
);
return $operations;
}
?> 
Comentarios recientes
hace 17 horas 50 mins
hace 1 día 10 horas
hace 1 semana 21 horas
hace 14 semanas 4 días
hace 19 semanas 19 horas
hace 20 semanas 2 días
hace 20 semanas 5 días
hace 20 semanas 5 días
hace 21 semanas 2 días
hace 22 semanas 1 día