Register templates programmatically
POM's public template authoring workflow stores archive, feed and single HTML templates through the supported settings interfaces. There is currently no general public function that lets a plugin register an arbitrary saved POM HTML template by including an internal template compiler file.
Supported choices
- Editor-owned template: create it under Settings → POM Theme → Templates and assign it in the relevant content/archive settings.
- Automated authoring: use the documented POM AI MCP template tools, which validate markup, permissions, write gates and assignments.
- Plugin-owned WordPress template: register normal WordPress hooks/templates in your plugin when the markup should remain source-controlled and does not need to be editable as a saved POM template.
Do not write POM settings/generated HTML/PHP files directly. Archive, feed and single templates are compiled and cached through a managed pipeline; bypassing it can leave stale or unsafe generated output.
For rendering existing saved templates, use the documented getter/replacement functions only where their context is public, and prefer the higher-level WordPress/POM rendering flow over calling a compiler helper.
If a stable programmatic registration API is added later, it must define identifier ownership, validation, assignment, compilation, translation registration, asset discovery, conflict behavior and removal. Until then, code-owned templates should remain normal plugin/child-theme templates.