Change default value of enableCustomFields to undefined #33931
+1
−1
Conversation
3 of 7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
mreishus commentedAug 6, 2021
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.