Automattic / Automattic/php-toolkit

Feature: Support arbitrary front matter metadata, categories, tags, author, featured image and SEO fields

Offen
#87 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
22
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Summary
Push MD supports a fixed set of basic front matter keys (`title`, `date`, `status`, `description`). We should add support for arbitrary front matter metadata key-values. To begin, create hooks for front matter meta data, and add support for hierarchical categories, tags, author attribution, featured image, and SEO fields, complete with strict push validation to prevent typos.

We can create "master" reference files for categories etc, and support CRUD based on changes in these files. All this should respect the user permissions though. Special case: for authors - no create / delete support.

### Features & How They Should Work

1. **Extensible Arbitrary Front Matter Meta Support (Primary Feature)**:
- Add developer hook framework allowing any custom post meta or third-party plugin metadata to be registered, exported, and imported via Markdown front matter:
- `push_md_supported_frontmatter_keys`
- `push_md_export_frontmatter`
- `push_md_import_frontmatter`
- `push_md_export_author` & `push_md_import_author`

2. **Master Reference Files & Strict Validation**:
- Generate `categories.md`, `tags.md`, and `authors.md` during checkout/seed.
- Pushing a post with an unknown category, tag, or author that is not in WordPress or the reference files should trigger a strict validation error to prevent typos.

3. **Categories, Tags, Authors & Featured Image**:
- `categories`: Support YAML lists, JSON arrays (`["Cat A", "Cat B"]`), or comma-separated strings. Full support for hierarchical category paths using `"Parent > Child"` (e.g., `Tech > WordPress`).
- `tags`: Support YAML/JSON lists or comma-separated tag strings.
- `author`: Match author by display name, username (`user_login`), nicename, or email address.
- `featured_image`: Resolve local path or attachment URL to WordPress attachment ID.

4. **Built-in SEO Metadata**:
- Build on top of the front matter hooks: supports `seo_title`, `seo_description`, and `seo_focus_keyword`.
- Automatically map to **Rank Math** or **Yoast SEO** post meta depending on which plugin is active.

### Acceptance Criteria
- [ ] Custom front matter keys can be registered via `push_md_supported_frontmatter_keys`.
- [ ] Front matter list parser supports YAML lists, JSON arrays, and comma-separated strings.
- [ ] Hierarchical categories (`Parent > Child`) parse and map correctly.
- [ ] Unknown terms/authors trigger a push validation error.
- [ ] Permission checks
- [ ] SEO fields map automatically to Rank Math / Yoast SEO meta.
- [ ] No creation or deletion of users from `authors.md` sync. Only updates.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Es werden keine Implementierungsdateien oder Tests genannt; beginne damit, die vorhandenen Einstiegspunkte für front-matter checkout, import/export und push-validation zu finden, und überprüfe anschließend die vorgeschlagenen Hook-Namen und Berechtigungsregeln. Als erledigt gilt die Aufgabe, wenn die aufgeführten Akzeptanzkriterien abgedeckt sind, einschließlich Listenformaten, hierarchischen Begriffen, strikter Validierung, SEO-Zuordnungen sowie der Tatsache, dass keine Autoren erstellt oder gelöscht werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php, wordpress
Bereich
backend, content
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.