@wordpress/edit-post
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/wordpress__edit-post package

7.33.0 • Public • Published

Edit Post

Edit Post Module for WordPress.

This package is meant to be used only with WordPress core. Feel free to use it in your own project but please keep in mind that it might never get fully documented.

Installation

Install the module

npm install @wordpress/edit-post

This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for such language features and APIs, you should include the polyfill shipped in @wordpress/babel-preset-default in your code.

Extending the post editor UI

Extending the editor UI can be accomplished with the registerPlugin API, allowing you to define all your plugin's UI elements in one place.

Refer to the plugins module documentation for more information.

The components exported through the API can be used with the registerPlugin (see documentation) API. They can be found in the global variable wp.editPost when defining wp-edit-post as a script dependency.

API

initializeEditor

Initializes and returns an instance of Editor.

Parameters

  • id string: Unique identifier for editor instance.
  • postType string: Post type of the post to edit.
  • postId Object: ID of the post to edit.
  • settings ?Object: Editor settings object.
  • initialEdits Object: Programmatic edits to apply initially, to be considered as non-user-initiated (bypass for unsaved changes prompt).

PluginBlockSettingsMenuItem

Undocumented declaration.

PluginDocumentSettingPanel

Undocumented declaration.

PluginMoreMenuItem

Undocumented declaration.

PluginPostPublishPanel

Deprecated since 6.6, use wp.editor.PluginPostPublishPanel instead.

Renders provided content to the post-publish panel in the publish flow (side panel that opens after a user publishes the post).

Parameters

  • props Object: Component properties.
  • props.className [string]: An optional class name added to the panel.
  • props.title [string]: Title displayed at the top of the panel.
  • props.initialOpen [boolean]: Whether to have the panel initially opened. When no title is provided it is always opened.
  • props.icon [WPBlockTypeIconRender]: The Dashicon icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  • props.children Element: Children to be rendered

Returns

  • Component: The component to be rendered.

PluginPostStatusInfo

Undocumented declaration.

PluginPrePublishPanel

Deprecated since 6.6, use wp.editor.PluginPrePublishPanel instead.

Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor).

Parameters

  • props Object: Component props.
  • props.className [string]: An optional class name added to the panel.
  • props.title [string]: Title displayed at the top of the panel.
  • props.initialOpen [boolean]: Whether to have the panel initially opened. When no title is provided it is always opened.
  • props.icon [WPBlockTypeIconRender]: The Dashicon icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  • props.children Element: Children to be rendered

Returns

  • Component: The component to be rendered.

PluginSidebar

Undocumented declaration.

PluginSidebarMoreMenuItem

Undocumented declaration.

reinitializeEditor

Used to reinitialize the editor after an error. Now it's a deprecated noop function.

store

Store definition for the edit post namespace.

Related

Type

  • Object

Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.

To find out more about contributing to this package or Gutenberg as a whole, please read the project's main contributor guide.



Code is Poetry.

/@wordpress/edit-post/

    Package Sidebar

    Install

    npm i @wordpress/edit-post

    Weekly Downloads

    16,955

    Version

    7.33.0

    License

    GPL-2.0-or-later

    Unpacked Size

    1.42 MB

    Total Files

    376

    Last publish

    Collaborators

    • riad
    • gutenbergplugin
    • mamaduka
    • ryanwelcher
    • garypendergast
    • aduth
    • adamsilverstein
    • gziolo
    • ntwb
    • noisysocks
    • kadamwhite
    • jorgefilipecosta
    • ellatrix
    • iandunn206
    • whyisjake
    • ockham
    • sirreal
    • nosolosw
    • wpisabel
    • ntsekouras
    • nerrad
    • desrosj
    • talldanwp
    • peterwilsoncc