Pretty permalinks
Public-readable entities get clean URLs without any per-page shortcode wiring:
/pfm/<entity_slug>/ → archive (renders [pfm_list])
/pfm/<entity_slug>/<record_slug>/ → single record (renders [pfm_record])
<record_slug> resolves to a sys_id by:
- Optional slug field — set
wp_options.pfm_slug_field_<entity_slug>to the name of a text field on the entity. PermalinkRouter matches the slug (aftersanitize_title()) against that column's value to find the row. - Hex literal fallback — when the slug is the 32-hex sys_id (with optional dashes stripped) it resolves directly.
Rewrite rules are flushed automatically when their signature changes (a stored hash compares with the registered shape) — never on every request.
Theme overrides: if a theme ships pfm/single-<entity_slug>.php or pfm/archive-<entity_slug>.php (with single.php / archive.php as wildcards) PermalinkRouter loads it via template_include instead of rendering inline. Otherwise the page is rendered with get_header() + the shortcode + get_footer() inside a <main class="pfm-permalink-page"> wrapper.
404 handling: unknown entity slugs and unresolvable record slugs both status_header(404) so the theme's 404 template runs.