Skip to content

Commit d8c2c6a

Browse files
jeryjjeryjgetdave
authored andcommitted
Fix navigation tag entity binding (#73255)
Co-authored-by: jeryj <jeryj@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org>
1 parent 015c3c7 commit d8c2c6a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/block-library/src/navigation-link/shared/use-entity-binding.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ export function useEntityBinding( { clientId, attributes } ) {
9898

9999
// Use the correct entity type based on kind.
100100
const entityType = isTaxonomy ? 'taxonomy' : 'postType';
101-
const entityRecord = getEntityRecord( entityType, type, id );
101+
// Convert 'tag' back to 'post_tag' for the API call
102+
// (it was converted from 'post_tag' to 'tag' for storage in updateAttributes)
103+
const typeForAPI = type === 'tag' ? 'post_tag' : type;
104+
const entityRecord = getEntityRecord( entityType, typeForAPI, id );
102105
const hasResolved = hasFinishedResolution( 'getEntityRecord', [
103106
entityType,
104-
type,
107+
typeForAPI,
105108
id,
106109
] );
107110

0 commit comments

Comments
 (0)