Skip to content

Commit

Permalink
Change default value of enableCustomFields to undefined (#33931)
Browse files Browse the repository at this point in the history
* Change default value of enableCustomFields to undefined

* Add comment explaining true/false/undefined for enableCustomFields

* Preferences: Hide 'Additional' section when custom fields are disabled and there are no meta boxes

* Tweak comments

Co-authored-by: Robert Anderson <robert@noisysocks.com>
  • Loading branch information
mreishus and noisysocks authored Aug 25, 2021
1 parent e7765c2 commit 4037448
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 2 additions & 4 deletions packages/edit-post/src/components/preferences-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,12 @@ export default function PreferencesModal() {
/>
</PageAttributesCheck>
</Section>
<Section
<MetaBoxesSection
title={ __( 'Additional' ) }
description={ __(
'Add extra areas to the editor.'
) }
>
<MetaBoxesSection />
</Section>
/>
</>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,10 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
/>
</PageAttributesCheck>
</Section>
<Section
<WithSelect(MetaBoxesSection)
description="Add extra areas to the editor."
title="Additional"
>
<WithSelect(MetaBoxesSection) />
</Section>
/>
</NavigationItem>
</NavigationMenu>
</Navigation>
Expand Down
9 changes: 7 additions & 2 deletions packages/editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export const PREFERENCES_DEFAULTS = {
* allowedBlockTypes boolean|Array Allowed block types
* richEditingEnabled boolean Whether rich editing is enabled or not
* codeEditingEnabled boolean Whether code editing is enabled or not
* enableCustomFields boolean Whether the WordPress custom fields are enabled or not
* enableCustomFields boolean Whether the WordPress custom fields are enabled or not.
* true = the user has opted to show the Custom Fields panel at the bottom of the editor.
* false = the user has opted to hide the Custom Fields panel at the bottom of the editor.
* undefined = the current environment does not support Custom Fields,
* so the option toggle in Preferences -> Panels to
* enable the Custom Fields panel is not displayed.
* autosaveInterval number Autosave Interval
* availableTemplates array? The available post templates
* disablePostFormats boolean Whether or not the post formats are disabled
Expand All @@ -27,6 +32,6 @@ export const EDITOR_SETTINGS_DEFAULTS = {

richEditingEnabled: true,
codeEditingEnabled: true,
enableCustomFields: false,
enableCustomFields: undefined,
supportsLayout: true,
};

0 comments on commit 4037448

Please sign in to comment.