-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Change default value of enableCustomFields to undefined #33931
Change default value of enableCustomFields to undefined #33931
Conversation
80cffd8
to
aef3920
Compare
@getsource How can I help move this one forward? |
I haven't tested it but this looks right to me 👍 Could you please add a comment explaining the difference between |
aef3920
to
40d8269
Compare
Sure, added in 40d8269 - was a bit unsure about location. |
…d and there are no meta boxes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works great! Thanks for the PR.
I tested by installing Advanced Custom Fields which disables custom fields in favour of its own meta boxes.
One (existing) issue I noticed is that we still show the "Additional" section in Preferences when custom fields are disabled and there are no meta boxes. I pushed up a fix for that.
👍 I do not have the capability to merge, so I'll need you help when it's time for that @noisysocks. :) |
Thanks @mreishus! |
Problem
When using a plugin to disable Custom Fields in the post editor, WordPress attempts to change
$editor_settings
to tell Gutenberg not to render the Custom Fields settings toggle in a preferences modal. However, Gutenberg is listening for a value that is impossible to send in PHP, and the settings toggle remains visible even when the feature itself is disabled.This change makes it so when PHP uses
unset()
to not send a value, thenundefined
is the value, allowing the field to be hidden.Steps to reproduce and more context
Please see #33912. This is tackling the same problem but in a different way.