diff --git a/docs/data/data-core-edit-post.md b/docs/data/data-core-edit-post.md index 0c711665b345c8..87ff8d8bb05a93 100644 --- a/docs/data/data-core-edit-post.md +++ b/docs/data/data-core-edit-post.md @@ -195,6 +195,19 @@ Returns an array of active meta box locations. Active meta box locations. +### isMetaBoxLocationVisible + +Returns true if a metabox location is active and visible + +*Parameters* + + * state: Post editor state. + * location: Meta box location to test. + +*Returns* + +Whether the meta box location is active and visible. + ### isMetaBoxLocationActive Returns true if there is an active meta box in the given location, or false @@ -209,6 +222,31 @@ otherwise. Whether the meta box location is active. +### getMetaBoxesPerLocation + +Returns the list of all the available meta boxes for a given location. + +*Parameters* + + * state: Global application state. + * location: Meta box location to test. + +*Returns* + +List of meta boxes. + +### getAllMetaBoxes + +Returns the list of all the available meta boxes. + +*Parameters* + + * state: Global application state. + +*Returns* + +List of meta boxes. + ### getMetaBox Returns the state of legacy meta boxes. @@ -326,30 +364,14 @@ Returns an action object used to toggle a plugin name flag. * pluginName: Plugin name. -### initializeMetaBoxState - -Returns an action object used to check the state of meta boxes at a location. - -This should only be fired once to initialize meta box state. If a meta box -area is empty, this will set the store state to indicate that React should -not render the meta box area. - -Example: metaBoxes = { side: true, normal: false }. - -This indicates that the sidebar has a meta box but the normal area does not. - -*Parameters* - - * metaBoxes: Whether meta box locations are active. - -### setActiveMetaBoxLocations +### setAvailableMetaBoxesPerLocation -Returns an action object used in signaling that the active meta box -locations have changed. +Returns an action object used in signaling +what Meta boxes are available in which location. *Parameters* - * locations: New active meta box locations. + * metaBoxesPerLocation: Meta boxes per location. ### requestMetaBoxUpdates diff --git a/docs/reference/deprecated.md b/docs/reference/deprecated.md index d7203f2edba183..8b064f1a5a2ce0 100644 --- a/docs/reference/deprecated.md +++ b/docs/reference/deprecated.md @@ -12,7 +12,8 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo - Writing resolvers as async generators has been removed. Use the controls plugin instead. - `wp.components.AccessibleSVG` component has been removed. Please use `wp.components.SVG` instead. - The `wp.editor.UnsavedChangesWarning` component no longer accepts a `forceIsDirty` prop. -- `initializeMetaBoxState` action (`core/edit-post`) has been removed. Use `setActiveMetaBoxLocations` action (`core/edit-post`) instead. +- `setActiveMetaBoxLocations` action (`core/edit-post`) has been removed. +- `initializeMetaBoxState` action (`core/edit-post`) has been removed. - `wp.editPost.initializeEditor` no longer returns an object. Use the `setActiveMetaBoxLocations` action (`core/edit-post`) in place of the existing object's `initializeMetaBoxes` function. - `setMetaBoxSavedData` action (`core/edit-post`) has been removed. - `getMetaBoxes` selector (`core/edit-post`) has been removed. Use `getActiveMetaBoxLocations` selector (`core/edit-post`) instead. diff --git a/lib/meta-box-partial-page.php b/lib/meta-box-partial-page.php index b6a7187813c5ea..ad1a6805d327e3 100644 --- a/lib/meta-box-partial-page.php +++ b/lib/meta-box-partial-page.php @@ -112,8 +112,8 @@ function gutenberg_filter_meta_boxes( $meta_boxes ) { $core_normal_meta_boxes = array( 'revisionsdiv', 'postexcerpt', - 'trackbacksdiv', 'postcustom', + 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv', 'slugdiv', @@ -289,9 +289,9 @@ function the_gutenberg_metaboxes() { * * @param array $wp_meta_boxes Global meta box state. */ - $wp_meta_boxes = apply_filters( 'filter_gutenberg_meta_boxes', $wp_meta_boxes ); - $locations = array( 'side', 'normal', 'advanced' ); - $active_meta_box_locations = array(); + $wp_meta_boxes = apply_filters( 'filter_gutenberg_meta_boxes', $wp_meta_boxes ); + $locations = array( 'side', 'normal', 'advanced' ); + $priorities = array( 'high', 'sorted', 'core', 'default', 'low' ); // Render meta boxes. ?>