The Editor’s UI Data Edit

Namespace: core/edit-post.

Selectors Selectors

areMetaBoxesInitialized areMetaBoxesInitialized

Returns true if meta boxes are initialized.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether meta boxes are initialized.

Top ↑

getActiveGeneralSidebarName getActiveGeneralSidebarName

Returns the current active general sidebar name, or null if there is no
general sidebar active. The active general sidebar is a unique name to
identify either an editor or plugin sidebar.

Examples:

  • edit-post/document
  • my-plugin/insert-image-sidebar

Parameters

  • state Object: Global application state.

Returns

  • ?string: Active general sidebar name.

Top ↑

getActiveMetaBoxLocations getActiveMetaBoxLocations

Returns an array of active meta box locations.

Parameters

  • state Object: Post editor state.

Returns

  • string[]: Active meta box locations.

Top ↑

getAllMetaBoxes getAllMetaBoxes

Returns the list of all the available meta boxes.

Parameters

  • state Object: Global application state.

Returns

  • Array: List of meta boxes.

Top ↑

getEditedPostTemplate getEditedPostTemplate

Retrieves the template of the currently edited post.

Returns

  • Object?: Post Template.

Top ↑

getEditorMode getEditorMode

Returns the current editing mode.

Parameters

  • state Object: Global application state.

Returns

  • string: Editing mode.

Top ↑

getMetaBoxesPerLocation getMetaBoxesPerLocation

Returns the list of all the available meta boxes for a given location.

Parameters

  • state Object: Global application state.
  • location string: Meta box location to test.

Returns

  • ?Array: List of meta boxes.

Top ↑

getPreference getPreference

Parameters

  • state Object: Global application state.
  • preferenceKey string: Preference Key.
  • defaultValue *: Default Value.

Returns

  • *: Preference Value.

Top ↑

getPreferences getPreferences

Returns the preferences (these preferences are persisted locally).

Parameters

  • state Object: Global application state.

Returns

  • Object: Preferences Object.

Top ↑

hasMetaBoxes hasMetaBoxes

Returns true if the post is using Meta Boxes

Parameters

  • state Object: Global application state

Returns

  • boolean: Whether there are metaboxes or not.

Top ↑

isEditingTemplate isEditingTemplate

Returns true if the template editing mode is enabled.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether we’re editing the template.

Top ↑

isEditorPanelEnabled isEditorPanelEnabled

Returns true if the given panel is enabled, or false otherwise. Panels are
enabled by default.

Parameters

  • state Object: Global application state.
  • panelName string: A string that identifies the panel.

Returns

  • boolean: Whether or not the panel is enabled.

Top ↑

isEditorPanelOpened isEditorPanelOpened

Returns true if the given panel is open, or false otherwise. Panels are
closed by default.

Parameters

  • state Object: Global application state.
  • panelName string: A string that identifies the panel.

Returns

  • boolean: Whether or not the panel is open.

Top ↑

isEditorPanelRemoved isEditorPanelRemoved

Returns true if the given panel was programmatically removed, or false otherwise.
All panels are not removed by default.

Parameters

  • state Object: Global application state.
  • panelName string: A string that identifies the panel.

Returns

  • boolean: Whether or not the panel is removed.

Top ↑

isEditorSidebarOpened isEditorSidebarOpened

Returns true if the editor sidebar is opened.

Parameters

  • state Object: Global application state

Returns

  • boolean: Whether the editor sidebar is opened.

Top ↑

isFeatureActive isFeatureActive

Returns whether the given feature is enabled or not.

Parameters

  • state Object: Global application state.
  • feature string: Feature slug.

Returns

  • boolean: Is active.

Top ↑

isInserterOpened isInserterOpened

Returns true if the inserter is opened.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether the inserter is opened.

Top ↑

isListViewOpened isListViewOpened

Returns true if the list view is opened.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether the list view is opened.

Top ↑

isMetaBoxLocationActive isMetaBoxLocationActive

Returns true if there is an active meta box in the given location, or false
otherwise.

Parameters

  • state Object: Post editor state.
  • location string: Meta box location to test.

Returns

  • boolean: Whether the meta box location is active.

Top ↑

isMetaBoxLocationVisible isMetaBoxLocationVisible

Returns true if a metabox location is active and visible

Parameters

  • state Object: Post editor state.
  • location string: Meta box location to test.

Returns

  • boolean: Whether the meta box location is active and visible.

Top ↑

isModalActive isModalActive

Returns true if a modal is active, or false otherwise.

Parameters

  • state Object: Global application state.
  • modalName string: A string that uniquely identifies the modal.

Returns

  • boolean: Whether the modal is active.

Top ↑

isPluginItemPinned isPluginItemPinned

Returns true if the plugin item is pinned to the header.
When the value is not set it defaults to true.

Parameters

  • state Object: Global application state.
  • pluginName string: Plugin item name.

Returns

  • boolean: Whether the plugin item is pinned.

Top ↑

isPluginSidebarOpened isPluginSidebarOpened

Returns true if the plugin sidebar is opened.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether the plugin sidebar is opened.

Top ↑

isPublishSidebarOpened isPublishSidebarOpened

Returns true if the publish sidebar is opened.

Parameters

  • state Object: Global application state

Returns

  • boolean: Whether the publish sidebar is open.

Top ↑

isSavingMetaBoxes isSavingMetaBoxes

Returns true if the Meta Boxes are being saved.

Parameters

  • state Object: Global application state.

Returns

  • boolean: Whether the metaboxes are being saved.

Top ↑

Actions Actions

Top ↑

closeGeneralSidebar closeGeneralSidebar

Returns an action object signalling that the user closed the sidebar.

Top ↑

closeModal closeModal

Returns an action object signalling that the user closed a modal.

Returns

  • Object: Action object.

Top ↑

closePublishSidebar closePublishSidebar

Returns an action object used in signalling that the user closed the
publish sidebar.

Returns

  • Object: Action object.

Top ↑

hideBlockTypes hideBlockTypes

Returns an action object used in signalling that block types by the given
name(s) should be hidden.

Parameters

  • blockNames string[]: Names of block types to hide.

Returns

  • Object: Action object.

Top ↑

initializeMetaBoxes initializeMetaBoxes

Initializes WordPress postboxes script and the logic for saving meta boxes.

Top ↑

metaBoxUpdatesFailure metaBoxUpdatesFailure

Returns an action object used to signal a failed meta box update.

Returns

  • Object: Action object.

Top ↑

metaBoxUpdatesSuccess metaBoxUpdatesSuccess

Returns an action object used to signal a successful meta box update.

Returns

  • Object: Action object.

Top ↑

openGeneralSidebar openGeneralSidebar

Returns an action object used in signalling that the user opened an editor sidebar.

Parameters

  • name ?string: Sidebar name to be opened.

Top ↑

openModal openModal

Returns an action object used in signalling that the user opened a modal.

Parameters

  • name string: A string that uniquely identifies the modal.

Returns

  • Object: Action object.

Top ↑

openPublishSidebar openPublishSidebar

Returns an action object used in signalling that the user opened the publish
sidebar.

Returns

  • Object: Action object

Top ↑

removeEditorPanel removeEditorPanel

Returns an action object used to remove a panel from the editor.

Parameters

  • panelName string: A string that identifies the panel to remove.

Returns

  • Object: Action object.

Top ↑

requestMetaBoxUpdates requestMetaBoxUpdates

Returns an action object used to request meta box update.

Top ↑

setAvailableMetaBoxesPerLocation setAvailableMetaBoxesPerLocation

Returns an action object used in signaling
what Meta boxes are available in which location.

Parameters

  • metaBoxesPerLocation Object: Meta boxes per location.

Top ↑

setIsEditingTemplate setIsEditingTemplate

Returns an action object used to switch to template editing.

Parameters

  • value boolean: Is editing template.

Returns

  • Object: Action object.

Top ↑

setIsInserterOpened setIsInserterOpened

Returns an action object used to open/close the inserter.

Parameters

  • value boolean|Object: Whether the inserter should be opened (true) or closed (false). To specify an insertion point, use an object.
  • value.rootClientId string: The root client ID to insert at.
  • value.insertionIndex number: The index to insert at.

Returns

  • Object: Action object.

Top ↑

setIsListViewOpened setIsListViewOpened

Returns an action object used to open/close the list view.

Parameters

  • isOpen boolean: A boolean representing whether the list view should be opened or closed.

Returns

  • Object: Action object.

Top ↑

showBlockTypes showBlockTypes

Returns an action object used in signalling that block types by the given
name(s) should be shown.

Parameters

  • blockNames string[]: Names of block types to show.

Returns

  • Object: Action object.

Top ↑

switchEditorMode switchEditorMode

Undocumented declaration.

Top ↑

toggleEditorPanelEnabled toggleEditorPanelEnabled

Returns an action object used to enable or disable a panel in the editor.

Parameters

  • panelName string: A string that identifies the panel to enable or disable.

Returns

  • Object: Action object.

Top ↑

toggleEditorPanelOpened toggleEditorPanelOpened

Returns an action object used to open or close a panel in the editor.

Parameters

  • panelName string: A string that identifies the panel to open or close.

Returns

  • Object: Action object.

Top ↑

toggleFeature toggleFeature

Triggers an action used to toggle a feature flag.

Parameters

  • feature string: Feature name.

Top ↑

togglePinnedPluginItem togglePinnedPluginItem

Triggers an action object used to toggle a plugin name flag.

Parameters

  • pluginName string: Plugin name.

Top ↑

togglePublishSidebar togglePublishSidebar

Returns an action object used in signalling that the user toggles the publish sidebar.

Returns

  • Object: Action object

Top ↑

updatePreferredStyleVariations updatePreferredStyleVariations

Returns an action object used in signaling that a style should be auto-applied when a block is created.

Parameters

  • blockName string: Name of the block.
  • blockStyle ?string: Name of the style that should be auto applied. If undefined, the “auto apply” setting of the block is removed.

Returns

  • Object: Action object.