Blocks & shortcodes
Embed PFM entities on any WordPress page using Gutenberg blocks or classic shortcodes. Both render the same React components.
Gutenberg blocks
| Block | What it renders |
|---|---|
| pfm/form | A create/edit form for an entity. Configure which entity and optional return URL. |
| pfm/list | A record list with optional filter, columns, page size, and view mode (table/kanban). |
| pfm/record | A single record card. Configure entity and sys_id. |
Each block appears as a placeholder card in the Gutenberg editor. The dynamic content renders on the front-end.
Shortcodes
| Shortcode | Key attributes |
|---|---|
[pfm_form] | entity, sys_id, return_url, success_message |
[pfm_list] | entity, filter, columns, page_size, view, saved_view |
[pfm_record] | entity, sys_id, template |
[pfm_full_app] | none — renders the full admin SPA |
List view modes
| Mode | Shortcode attribute | Description |
|---|---|---|
| Table | view="table" (default) | Rows and columns with sorting and inline edit |
| Kanban | view="kanban" | Cards grouped by a field value |
Permissions
- Blocks and shortcodes respect PFM's permission system
- Anonymous users see the form if the entity has
publicincan_create_roles - Logged-in users see the form if they match the entity's permission role
- Denied users see a login prompt or "no permission" message
CSS isolation
All front-end embeds are scoped under .pfm-embed to prevent theme conflicts. Key rules:
- Fonts and colours inherit from the theme via
theme.jsonvariables - No
!importantdeclarations - RTL languages supported via logical properties
- No icon fonts — all icons are inline SVG
- Bundle size target: < 50KB gzipped