I'm trying to change the text from Remove button in my file and image fields.
For the field collection items I used this code.
function MY_MODULE_field_widget_form_alter(&$element, &$form_state, $context)
{
$element['actions']['remove_button']['#value'] = t('x');
}
It works fine. For file and image fields I tried this code.
function MY_MODULE_preprocess_file_widget_multiple(&$variables) {
if( strcmp($variables['element']['#type'], 'details') == 0 ){
$variables['element'][0]['remove_button']['#value'] = t('x');
}
}
It doesn't work. With MY_MODULE_field_widget_form_alter()
I can't get the Remove button.