ParagraphBlocksInlineParagraphsWidget.php in Paragraph blocks 3.x
File
src/Plugin/Field/FieldWidget/ParagraphBlocksInlineParagraphsWidget.php
View source
<?php
namespace Drupal\paragraph_blocks\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\paragraphs\Plugin\Field\FieldWidget\InlineParagraphsWidget;
class ParagraphBlocksInlineParagraphsWidget extends InlineParagraphsWidget {
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$element = parent::formElement($items, $delta, $element, $form, $form_state);
$subform =& $element['subform'];
if (isset($subform['#parents']) && count(array_intersect($subform['#parents'], [
'subform',
])) > 1) {
$subform['admin_title']['#access'] = FALSE;
}
return $element;
}
}