You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Blockparty Modal is a WordPress plugin that lets you add accessible modal dialog
16
16
-**Modal dialog**: Uses the native `<dialog>` element for semantics and accessibility
17
17
-**Configurable content**: Title (with heading level), rich text content, and optional close button
18
18
-**Close behaviour**: Choose how the modal closes — click outside, close button only, or prevent closing by backdrop
19
-
-**Trigger linking**: Link any block (e.g. core/button) to open a specific modal via `linkedModalId`
19
+
-**Trigger linking**: Link a block to open a specific modal via `linkedModalId`; by default only the Button block is allowed as a trigger (filterable)
20
20
-**Stable modal ID**: Each modal can have a unique ID for trigger association
21
21
-**Layout & styling**: Supports wide and full-width alignment, dimensions, colors, and spacing
22
22
-**Internationalized**: Multilingual support with translation files (French included)
@@ -70,11 +70,27 @@ npm run build
70
70
-**Close behaviour** — "Any" (click outside or close button), "Close button only", or "None"
71
71
-**Close button** — show or hide the close button
72
72
-**Prevent scroll** — lock body scroll when the modal is open
73
-
4. To open the modal from a button:
74
-
- Add a **Button** block (or another block that supports the modal trigger)
75
-
- In the block settings, set**Linked Modal ID**to the same value as the modal’s **Modal ID**
73
+
4. To open the modal from a trigger block:
74
+
- Add a **Button** block (by default, only the Button block can be a modal trigger)
75
+
- In the block sidebar, open**Attached modal**and select the modal to open
76
76
- On the frontend, clicking that button will open the corresponding modal
77
77
78
+
### Blocks allowed as modal triggers
79
+
80
+
By default, only the **core/button** block can be linked to a modal. To allow other blocks (e.g. paragraph, image, or custom blocks), use the filter `blockparty_modal_trigger_allowed_blocks` in your theme or plugin:
81
+
82
+
```php
83
+
add_filter( 'blockparty_modal_trigger_allowed_blocks', function ( $blocks ) {
"description": "Insert a modal dialog that opens on trigger. Configure content and behaviour in the editor; the modal is displayed on the frontend when activated.",
0 commit comments