Edit Post: Fix warning in 'useMetaBoxInitialization' hook#77311
Edit Post: Fix warning in 'useMetaBoxInitialization' hook#77311
Conversation
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 5faac95. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24392333548
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 00bd3cd |
What?
This is a follow-up to #76939. Waiting for feedback on larger refactoring - #76939 (comment).
PR fixes
useSelectwarning triggered byuseMetaBoxInitialization, which was returning a new array reference on each call when metaboxes are disabled.See: https://make.wordpress.org/core/2025/03/12/data-a-helpful-performance-warning-for-developers-in-the-useselect-hook/
How?
Return undefined when the feature is disabled and account for it later.
Testing Instructions
WP_DEBUGandSCRIPT_DEBUG.Testing Instructions for Keyboard
Same.
Screenshots or screencast
Use of AI Tools
None.