Modal Templates
A WordPress block plugin that lets you design modal contents as template parts in the Site Editor, then attach them to any button or group block as a trigger.
★ 0stars
8release downloads
0forks
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/philhoyt/modal-templates/releases/download/V1.1.1/modal-templates.zipFrom the readme
Modal Templates
Design modal contents as template parts in the Site Editor and attach them to any button or group block as a trigger.
Description
Modal Templates lets you design modal content as template parts in the Site Editor, then attach them to any Button or Group block. When a trigger is clicked, the pre-rendered template part opens in a modal shell.
Because rendering happens inside the renderblock filter, it runs within the active post context. A single template part can render dynamic, per-post content when used inside a Query Loop — each post gets its own pre-rendered modal with that post's data.
Features
- Block editor native — extends core Button and Group blocks via addFilter.
- Site Editor integration — create and edit modal template parts within the editor; "Edit in Site Editor" link opens directly to the selected part.
- Query Loop support — one template part, dynamic content per post.
- Full accessibility — role="dialog", aria-modal, aria-labelledby (dynamic from heading), aria-expanded, aria-controls, aria-haspopup, inert on background content, focus trap, focus return on close, ESC to close, iOS scroll lock.
- Close animation — fade and slide out with mobile
Read the full README on GitHub →