Allow plugins to register Push MD content adapters
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc Push_MD_Plugin::$supported_post_types và get_supported_post_types() trong plugins/push-md/class-push-md-plugin.php, sau đó lần theo các flow hiện có của post/page và các entity khác được nêu trong các tiêu chí chấp nhận. Xác định contract của adapter và ranh giới của registry trước khi triển khai; được coi là hoàn thành khi một plugin riêng có thể round-trip một CPT phân cấp mà vẫn bảo toàn validation, permissions, paths, previews và behavior của các entity hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 22
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Automattic/php-toolkit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Automattic/php-toolkit#89 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Automattic/php-toolkit#102 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
Automattic/php-toolkit#95 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Automattic/php-toolkit#91 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Automattic/php-toolkit#88 ·
Tất cả issue của Automattic/php-toolkit
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/safe-publish#594 ·
-
HttpClient
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
symfony/symfony-docs#23092 ·
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Перевод устарел
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100