wp-plugin-presenter
Installation
SKILL.md
WordPress plugin: native presenters
For plugin code that turns DTOs / domain objects into output shapes. A presenter chooses fields, computes labels, formats dates/numbers, redacts sensitive values, and returns arrays that controllers can send to REST, AJAX, admin tables, JS config, email templates, exports, or views.
This skill is intentionally better-data-free. If the project already uses
better-data, run bd-presenter; otherwise use this native pattern.
When to load references
- Need complete REST/admin/JS/email/export presenter examples, collection presenter, or redaction pattern: read references/presenter-context-patterns.md.
- Refactoring a controller that returns raw DTOs, raw arrays,
WP_Post,WC_Order,get_object_vars(), or pre-escaped REST payloads: read references/before-after-controller-output.md.
Misconception this skill corrects
"The DTO already has
to_array(), so the controller can return that everywhere."