Skip to main content
The @wordpress/edit-post package provides the post editor interface for WordPress. It includes components and functionality for extending the post editor UI.
This package is primarily meant for use within WordPress core. While you can use it in your projects, be aware that it may not be fully documented for external use.

Installation

Extending the Post Editor

The primary way to extend the post editor is through the registerPlugin API:

Plugin Components

PluginSidebar

Adds a custom sidebar to the post editor.

PluginSidebarMoreMenuItem

Adds a menu item to open your sidebar.

PluginDocumentSettingPanel

Adds a panel to the document settings sidebar.

PluginPostStatusInfo

Adds content to the post status section.

PluginPrePublishPanel

Adds content to the pre-publish panel.

PluginPostPublishPanel

Adds content to the post-publish panel.

PluginMoreMenuItem

Adds an item to the more menu (three dots).

PluginBlockSettingsMenuItem

Adds an item to the block settings menu.

Initializing the Editor

The initializeEditor function sets up the post editor:

Store

Access the edit-post store for UI state:

Complete Plugin Example

Here’s a complete example of a post editor plugin:

Best Practices

  1. Use the Plugin API - Always use registerPlugin for extensions
  2. Unique Names - Ensure plugin and component names are unique
  3. Proper Icons - Use WordPress dashicons for consistency
  4. Conditional Rendering - Show controls only when relevant
  5. Persist Settings - Save custom data in post meta or options

Learn More