From efa3b5d93cc9e3b4e8038068c9347dca8eea83ed Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Tue, 17 Sep 2024 23:08:20 +0200 Subject: [PATCH] Read title instead of label --- packages/editor/src/bindings/post-meta.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/bindings/post-meta.js b/packages/editor/src/bindings/post-meta.js index 100c8802696fe8..20013bd8f246bb 100644 --- a/packages/editor/src/bindings/post-meta.js +++ b/packages/editor/src/bindings/post-meta.js @@ -18,7 +18,9 @@ function getMetadata( registry, context, registeredFields ) { // Populate the `metaFields` object with the default values. Object.entries( registeredFields || {} ).forEach( ( [ key, props ] ) => { - metaFields[ key ] = props.default; + if ( props.default ) { + metaFields[ key ] = props.default; + } } ); } else { @@ -47,7 +49,7 @@ export default { const metaKey = source.args.key; newValues[ attributeName ] = metaFields?.[ metaKey ] ?? - registeredFields?.[ metaKey ]?.label ?? + registeredFields?.[ metaKey ]?.title ?? metaKey; } return newValues;