From 0495462c864ba51a57f8ce5a219ea1ab75da6db9 Mon Sep 17 00:00:00 2001 From: lipemat Date: Tue, 12 Mar 2024 11:48:35 -0500 Subject: [PATCH] Add a notice about Custom Fields overriding values in usePostMeta Nasty conflict, hard to troubleshoot. https://github.com/WordPress/gutenberg/issues/23078 --- src/hooks/usePostMeta.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/usePostMeta.ts b/src/hooks/usePostMeta.ts index 0ff95d7..709f917 100644 --- a/src/hooks/usePostMeta.ts +++ b/src/hooks/usePostMeta.ts @@ -22,6 +22,11 @@ export function usePostMeta( me * Will return the current meta state as well as the original meta * state before any changes were made. * + * @notice The "Custom Fields" panel will override changes made using this hook unless the + * meta field is filtered as `is_protected_meta`. + * @see https://github.com/WordPress/gutenberg/issues/23078 + * + * * @link https://developer.wordpress.org/block-editor/how-to-guides/plugin-sidebar-0/plugin-sidebar-5-update-meta/ * * @param {string} [metaKey] - Pass a meta key to work with an individual meta key.