alleyinteractive / alleyinteractive/wp-seo

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

Đang mở
#177 0 bình luận 0 reaction 1 người được giao Được @anubisthejackle nhận Xem trên GitHub
Ngôn ngữ chính
PHP
Star
45
Fork
13
Merge trung bình
12 ngày 16 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

First confirm the target branch, since the Open Graph implementation is on v2.0 rather than main. Read src/features/class-open-graph.php and the sidebar UI referenced by #141, then trace register_meta_helper() and the wp_head output; done means the three overrides, fallback chain, supported-post-type rendering, and accompanying tests are covered.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php, wordpress
Lĩnh vực
backend, web-dev
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.