Skip to content

Commit

Permalink
Block bindings: Lock editing in fields in editor if meta fields panel…
Browse files Browse the repository at this point in the history
… is opened. (#64738)

* Lock editing bindings if meta fields interface is opened

* Update snapshots

* Refactor the EnableCustomFieldsOption component to improve code readability and maintainability.

* Update snapshots

* Remove extra text

Co-authored-by: cbravobernal <[email protected]>
Co-authored-by: SantosGuillamot <[email protected]>
Co-authored-by: artemiomorales <[email protected]>
Co-authored-by: gziolo <[email protected]>
  • Loading branch information
5 people authored Sep 4, 2024
1 parent 9cf3162 commit 2807adb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/editor/src/bindings/post-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export default {
if ( fieldValue === undefined ) {
return false;
}
// Check that custom fields metabox is not enabled.
const areCustomFieldsEnabled =
select( editorStore ).getEditorSettings().enableCustomFields;
if ( areCustomFieldsEnabled ) {
return false;
}

// Check that the user has the capability to edit post meta.
const canUserEdit = select( coreDataStore ).canUser( 'update', {
Expand Down

1 comment on commit 2807adb

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 2807adb.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10698867465
📝 Reported issues:

Please sign in to comment.