Since WordPress 6.7, plugin developers can extend the editor's Preview dropdown using the PluginPreviewMenuItem component from @wordpress/editor. This walkthrough builds a 'Social Card Preview' plugin that adds a custom dropdown entry, opens a modal, and reads post title, excerpt, and featured image from the editor store in

8m read time From developer.wordpress.org
Post cover image
Table of contents
What is PluginPreviewMenuItem?Social Card Preview examplePlugin setupRegistering the preview menu itemBuilding the social card modalThe Card Preview markupStyling the cardTesting with WordPress PlaygroundGoing further

Sort: