5 * Test module for testing the paragraphs module.
8 use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget;
11 * Implements hook_paragraphs_widget_actions_alter().
13 function paragraphs_test_paragraphs_widget_actions_alter(&$widget_actions, &$context) {
14 if (\Drupal::state()->get('paragraphs_test_dropbutton')) {
15 $widget_actions['dropdown_actions']['test_button'] = ParagraphsWidget::expandButton([
17 '#value' => t('Add to library'),
19 '#name' => 'field_paragraphs_test',
21 '#paragraphs_mode' => 'remove',