Allow plugins to register Push MD content adapters
还没有人认领这个 Issue。
评估
调研方向
首先阅读 plugins/push-md/class-push-md-plugin.php 中的 Push_MD_Plugin::$supported_post_types 和 get_supported_post_types(),然后跟踪验收标准中所述的现有 post/page 及其他 entity 流程。在实现之前定义 adapter contract 和 registry 边界;当一个独立 plugin 能够对 hierarchical CPT 执行 round-trip,同时保留 validation、permissions、paths、previews 以及现有 entity behavior 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Problem
Push MD hardcodes the WordPress entities it exports and imports. Markdown post types begin with post and page, while Guidelines, raw block entities, and Global Styles are added through private type-specific branches in Push_MD_Plugin.
Current source: Push_MD_Plugin::$supported_post_types and get_supported_post_types().
A plugin cannot register its own content model with Push MD without modifying Push MD itself. Adding a post-type-name filter alone would be unsafe: path identity, hierarchy, metadata, taxonomy relationships, import validation, capabilities, branch previews, seeding, and collision handling must use the same contract.
Use case
The WP Docs proof of concept needs a private, hierarchical documentation post type to round-trip through Push MD while WordPress remains the content source of truth. Collections and topics must retain deterministic taxonomy relationships, and the documentation hierarchy must map to stable repository paths.
This should be solved as a generic Push MD extension point rather than a WP Docs special case.
Proposed direction
Add a fail-closed content-adapter registry that third-party plugins can populate before Push MD seeds or synchronizes its repository.
An adapter should define enough behavior for Push MD to apply one consistent contract across:
- entity discovery and supported statuses;
- stable path and identity mapping;
- serialization and parsing;
- hierarchy and dependency validation;
- taxonomy or other declared metadata relationships;
- create, update, move, and trash planning;
- read/edit/create/delete capability checks;
- branch preview projection where supported.
Push MD should continue to own Git protocol handling, stale-state checks, whole-push validation, path safety, collision rejection, atomic planning, repository persistence, and authentication. Adapters provide WordPress entity semantics, not alternate Git behavior.
The built-in post/page behavior should use the same registry where practical so extension behavior cannot drift from core behavior.
Acceptance criteria
- A separate plugin can register a Markdown-backed hierarchical CPT without editing Push MD source.
- Registration rejects duplicate adapter IDs, duplicate post types, reserved or colliding paths, invalid callbacks, and registration after the registry is frozen.
- Seeder counts, WordPress export, path parsing, push planning/application, permission checks, and branch previews resolve through the registered adapter contract.
- All incoming changes are parsed and validated before the first WordPress mutation; an adapter failure rejects the complete push.
- Deterministic tests cover clone, update, create, hierarchy change, taxonomy relationships, collision rejection, stale push rejection, and trash behavior for a plugin-defined CPT.
- Existing posts, pages, templates, template parts, navigation, Global Styles, and Guidelines retain their current repository paths and behavior.
- Public extension documentation includes a minimal third-party adapter example and lifecycle timing.
Consumer
Tracked WP Docs work: chubes4/wp-docs#19.
- 主要语言
- PHP
- 星标
- 22
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Automattic/php-toolkit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Automattic/php-toolkit#89 ·
-
难度 5/5 一周以上 新手友好度 35/100
Automattic/php-toolkit#102 ·
-
难度 3/5 1-2 天 新手友好度 76/100
Automattic/php-toolkit#95 ·
-
难度 5/5 一周以上 新手友好度 25/100
Automattic/php-toolkit#91 ·
-
难度 4/5 3-5 天 新手友好度 48/100
Automattic/php-toolkit#88 ·
查看 Automattic/php-toolkit 的全部 Issue
相似的 Issue
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
UX
难度 2/5 1-3 小时 新手友好度 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
bug customer-reported
难度 2/5 1-3 小时 新手友好度 65/100
MagnaCapax/PMSS#949 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Automattic/static-site-importer#1829 ·