Drupal - How to hide the text formats help text?
AFAIK there is currently no core UI to control showing/hiding of those tips.
Th simplify module, one of the D7 choices you link to, has a D8 port that may still help with this.
The Allowed formats module is an incubator for future core improvements in the area of giving sitebuilder's UI control over text format and their help tips.
== UPDATE ==
A patch just committed to that module gives sitebuilders considerable control over help tips, using UI settings on the widgets.
== OLD ==
There are a couple of relevant issue in the issue queue for that module:
Allow to control if "About text formats" link should be shown or not
Allow to hide text format help text for Text(formatted)
The first of those issues contains this code from floretan, which points in the direction you would need to go to hide the help by custom code:
<?php
/**
* Implements hook_field_widget_form_alter().
*/
function allowed_formats_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {
if ($context['widget'] instanceof \Drupal\text\Plugin\Field\FieldWidget\TextareaWidget) {
$element['#after_build'][] = '_allowed_formats_remove_textarea_help';
}
}
/**
* #after_build callback.
*/
function _allowed_formats_remove_textarea_help($form_element, FormStateInterface $form_state) {
if (isset($form_element['format'])) {
// All this stuff is needed to hide the help text.
unset($form_element['format']['guidelines']);
unset($form_element['format']['help']);
unset($form_element['format']['#type']);
unset($form_element['format']['#theme_wrappers']);
}
return $form_element;
}
?>
This work for me in drupal 8, You have to change the field machine name
<?php
use Drupal\Core\Form\FormStateInterface;
/**
* 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;
}
As simple and general solution (for all fields) is to install a contributed theme outside core and use that as a administration theme and simply do something like
.filter-guidelines-item .tips { display:none; }
Or patch one of the themes inside core and make a note to repatch when you do an upgrade.