alleyinteractive / alleyinteractive/wp-seo

Add support for Twitter Card image/title/description overrides on posts

未关闭
#177 0 条评论 0 个 reaction 已指派 1 人 已被 @anubisthejackle 认领 在 GitHub 查看
主要语言
PHP
星标
45
派生
13
平均合并
12 天 16 小时
30 天内合并 PR
5

描述

### Description

As seen in #161, this issue covers adding per-post override fields for Twitter Card metadata (image, title, description), following the same pattern already established for Open Graph tags in #124 (implemented on the `v2.0` branch via `src/features/class-open-graph.php`).

### Acceptance Criteria

- Add per-post fields for Twitter Card title, description, and image, using the same sidebar UI location as the Open Graph fields (see #141).
- Register the fields as post meta via `register_meta_helper()` so they're exposed in the REST API, consistent with the Open Graph fields.
- Fall back in this order when a Twitter field is not explicitly set: Twitter field → corresponding Open Graph field (which itself falls back to post title / excerpt / featured image) → nothing.
- Render `twitter:card`, `twitter:title`, `twitter:description`, and `twitter:image` tags in `wp_head` on singular posts, gated by post type support (mirroring `add_post_type_support( $post_type, 'open-graph' )`).
- Add tests covering the override and fallback chain.

### Use Case

Customizing post meta details such as Twitter Card image, title, and description so links shared on Twitter/X display the intended preview.

### Note

This depends on the Open Graph feature currently living on the `v2.0` branch, not `main`. Confirm which branch this should target before implementation.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。