Skip to content

Commit

Permalink
Read title instead of label
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Sep 17, 2024
1 parent 6288d34 commit efa3b5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/editor/src/bindings/post-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -47,7 +49,7 @@ export default {
const metaKey = source.args.key;
newValues[ attributeName ] =
metaFields?.[ metaKey ] ??
registeredFields?.[ metaKey ]?.label ??
registeredFields?.[ metaKey ]?.title ??
metaKey;
}
return newValues;
Expand Down

0 comments on commit efa3b5d

Please sign in to comment.