/* Implements hook_field_widget_form_alter().
*/
function YOURMODULENAME_form_alter(&$form, &$form_state, &$form_id) {
$form['field_short_description']['widget']['#after_build'][] = '_allowed_formats_remove_textarea_help';
}
function _allowed_formats_remove_textarea_help($form_element, FormStateInterface $form_state) {
if (isset($form_element[0]['format'])) {
// All this stuff is needed to hide the help text.
unset($form_element[0]['format']['guidelines']);
unset($form_element[0]['format']['help']);
unset($form_element[0]['format']['#type']);
unset($form_element[0]['format']['#theme_wrappers']);
$form_element[0]['format']['format']['#access'] = FALSE;
}
return $form_element;
}
Comments
Post a Comment