Skip to content

Meta Boxes: Don't render an empty panel when only side boxes exist - #84196

Closed
snehapatil2001 wants to merge 2 commits into
WordPress:trunkfrom
snehapatil2001:fix/84173
Closed

snehapatil2001 wants to merge 2 commits into
WordPress:trunkfrom
snehapatil2001:fix/84173

Conversation

@snehapatil2001

Copy link
Copy Markdown
Contributor

What?

Closes #84173.

Stops the editor from rendering an empty "Meta Boxes" panel when the only registered meta boxes are in the side location.

Why?

MetaBoxesMain decided whether to show the bottom panel by checking the normal, advanced and side locations. The panel body only renders normal and advanced, because side meta boxes are rendered separately in the sidebar. A site with only side meta boxes therefore got the "Meta Boxes" toggle bar and a drag handle with nothing inside.

How?

Removes isMetaBoxLocationVisible( 'side' ) from the hasAnyVisible condition in MetaBoxesMain (packages/edit-post/src/components/layout/index.jsx), so the panel only shows when normal or advanced has meta boxes. Adds a changelog entry for @wordpress/edit-post.

Testing Instructions

  1. Register a meta box in the side context only, for example add_meta_box( 'repro', 'Repro', $callback, 'post', 'side' ). Make sure Screen Options → Custom Fields is unchecked, since that adds a normal box.
  2. Open a post in the editor.
  3. Before this PR: an empty "Meta Boxes" bar appears at the bottom of the editor. After this PR: no bottom panel is rendered, and the side meta box still appears in the sidebar.
  4. Also register a meta box in normal or advanced. The "Meta Boxes" panel should appear and work as before.

Testing Instructions for Keyboard

  1. With only a side meta box registered, press Tab through the editor. Focus should never land on a "Meta Boxes" toggle button at the bottom.
  2. With a normal or advanced meta box registered, the "Meta Boxes" toggle should be reachable with Tab and open or close with Enter or Space.

@github-actions github-actions Bot added the [Package] Edit Post /packages/edit-post label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: snehapatil2001 <snehapatil02@git.wordpress.org>
Co-authored-by: andfinally <andfinally@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@t-hamano

t-hamano commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Hi @snehapatil2001, thanks for your contribution.

I don't think this is the ideal approach, so I'm going to close this issue. Please see #84173 (comment) for more details.

@t-hamano t-hamano closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Post /packages/edit-post

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MetaBoxesMain renders empty "Meta Boxes" panel when there are only sidebar metaboxes

2 participants