I would like to change the string 'select media' in a media form element to something like 'select picture'.

Is there a way to change this string for a certain field? So for a single field in a single content type?
I tried with theme_form_element and hook_form_alter but the information doesn't seem to be available there.

Comments

peteruithoven’s picture

One way:

function YOURMODULENAME_element_info_alter(&$type) {
	$type['media']['#process'][] = 'checkin_media_element_proces';
}
/**
 * extra #process callback for the media form element.
 */
function checkin_media_element_proces(&$element, &$form_state, $form) {
	$element['select']['#title'] = t('Add image');
	return $element;
}
devin carlson’s picture

Status: Active » Closed (fixed)

Fixed as per #1.