Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasMetaBoxes selector returns true even when user has disabled all metaboxes from displaying #52724

Closed
fabiankaegy opened this issue Jul 18, 2023 · 2 comments
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended

Comments

@fabiankaegy
Copy link
Member

fabiankaegy commented Jul 18, 2023

Description

The selector wp.data.select('core/edit-post').hasMetaBoxes() returns true even after a user has disabled all metaboxes from displaying via the display settings.

This issue is currently preventing the block editor from getting displayed in an iframe even when the metaboxes aren't actually displayed.

Step-by-step reproduction instructions

  1. Enable a plugin that loads a traditional metabox such as Yoast SEO
  2. Open the editor and disable all the metabox panels in the Settings -> Panels menu
  3. Open the browser console and run the wp.data.select('core/edit-post'). hasMetaBoxes() selector
  4. See that it still returns true.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.3 Beta 4
  • no gutenberg plugin
  • emptytheme

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@fabiankaegy fabiankaegy added [Type] Bug An existing feature does not function as intended [Feature] Meta Boxes A draggable box shown on the post editing screen labels Jul 18, 2023
@youknowriad
Copy link
Contributor

Yes, I don't think hasMetaBoxes mean hasVisibleMetaboxes in this case. It's more about the meta boxes that are sent from the server. That said, even if we had hasVisibleMetaboxes, I'm not sure that it would have been the right selector for the iframed editor because adding and removing the iframe when the value changes on the fly is a bit risky. (Re-rendering everything...)

@fabiankaegy
Copy link
Member Author

Thanks for that explanation. Closing this for now then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants