Adds a "Social Card Preview" option to the WordPress editor Preview dropdown, showing how a post will look when shared on X. As example plugin for a WordPress develop blog post.
This plugin is part of the article How to add custom entries to the editor Preview dropdown on the WordPress developer blog
It is only for educational purposes and not meant to be used in production. For questions, please contact @bph via WPSlack (Account required).
- Mock X card preview with featured image, title, excerpt, and domain
- Live updates as you edit — reads directly from the editor store
- WordPress 6.7+
- PHP 7.4+
npm install
npm run buildFor development with auto-rebuild:
npm run startYou can test locally with WordPress Playground:
npx @wp-playground/cli@latest server --auto-mount --loginGPL-2.0-or-later