function custom_add_another_process_file_buttons_labels in Custom add another 8
Process element callback for multiple Managed file widgets.
1 string reference to 'custom_add_another_process_file_buttons_labels'
File
- ./
custom_add_another.module, line 151 - Allows the 'Add another item' button text to be customised.
Code
function custom_add_another_process_file_buttons_labels($element, FormStateInterface $form_state, $form) {
if (isset($element['#custom_add_another_value']) || isset($element['#custom_remove'])) {
if (isset($element['#custom_add_another_value']) && isset($element['upload_button']['#value']) && $element['upload_button']['#value'] != t($element['#custom_add_another_value'])) {
$element['upload_button']['#value'] = t($element['#custom_add_another_value']);
}
if (isset($element['#custom_remove']) && isset($element['remove_button']['#value'])) {
$element['remove_button']['#value'] = t($element['#custom_remove']);
}
}
return $element;
}