Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / paragraphs / paragraphs.api.php
1 <?php
2
3 /**
4  * @file
5  * Hooks and documentation related to paragraphs module.
6  */
7
8 /**
9  * @addtogroup hooks
10  * @{
11  */
12
13 /**
14  * Alter the information provided in
15  * \Drupal\paragraphs\Annotation\ParagraphsBehavior.
16  *
17  * @param $paragraphs_behavior
18  *   The array of paragraphs behavior plugins, keyed on the
19  *   machine-readable plugin name.
20  */
21 function hook_paragraphs_behavior_info_alter(&$paragraphs_behavior) {
22   // Set a new label for the my_layout plugin instead of the one
23   // provided in the annotation.
24   $paragraphs_behavior['my_layout']['label'] = t('New label');
25 }
26
27 /**
28  * Alter paragraphs widget.
29  *
30  * @param array $widget_actions
31  *   Array with actions and dropdown widget actions.
32  * @param array $context
33  *   An associative array containing the following key-value pairs:
34  *   - form: The form structure to which widgets are being attached. This may be
35  *     a full form structure, or a sub-element of a larger form.
36  *   - widget: The widget plugin instance.
37  *   - items: The field values, as a
38  *     \Drupal\Core\Field\FieldItemListInterface object.
39  *   - delta: The order of this item in the array of subelements (0, 1, 2, etc).
40  *   - element: A form element array containing basic properties for the widget.
41  *   - form_state: The current state of the form.
42  *   - paragraphs_entity: the paragraphs entity for this widget. Might be
43  *     unsaved, if we have just added a new item to the widget.
44  */
45 function hook_paragraphs_widget_actions_alter(array &$widget_actions, array &$context) {
46 }
47
48 /**
49  * @} End of "addtogroup hooks".
50  */