function rh_file_form_file_entity_add_upload_alter in Rabbit Hole 7.2
Implements hook_form_FORM_ID_alter().
This will add Rabbit Hole options to the file form when adding a new file. The user will be able to override the default Rabbit Hole options.
File
- modules/
rh_file/ rh_file.module, line 55 - Main module file for Rabbit Hole files module.
Code
function rh_file_form_file_entity_add_upload_alter(&$form, $form_state) {
if (!isset($form['#entity'])) {
// Don't add the form if the file hasn't been uploaded yet.
return;
}
// Add the Rabbit Hole form.
rabbit_hole_form($form, 'file', $form['#entity']->type, 'rh_file', $form['#entity']);
}