Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Card Preview

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

Features

  • Mock X card preview with featured image, title, excerpt, and domain
  • Live updates as you edit — reads directly from the editor store

Requirements

  • WordPress 6.7+
  • PHP 7.4+

Development

npm install
npm run build

For development with auto-rebuild:

npm run start

Testing

You can test locally with WordPress Playground:

npx @wp-playground/cli@latest server --auto-mount --login

License

GPL-2.0-or-later

About

Example plugin for Developer Blog article on "How to add custom entried to the editor preview dropdown"

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages