Skip to content

Commit 725f23e

Browse files
authored
Update normalize.js
1 parent 10747da commit 725f23e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/gatsby-source-wordpress/src/normalize.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,9 @@ exports.mapTagsCategoriesToTaxonomies = entities =>
225225

226226
exports.mapElementsToParent = entities => entities.map(e => {
227227
if (e.wordpress_parent) {
228-
// Replace wordpress_parent with a link to the parent node of type.
228+
// Create parent_element with a link to the parent node of type.
229229
e.parent_element___NODE = entities
230-
.filter(el => el.__type === e.__type)
231-
.find(t => t.wordpress_id === e.wordpress_parent).id
232-
delete e.wordpress_parent
230+
.find(t => t.wordpress_id === e.wordpress_parent && t.__type === e.__type).id
233231
}
234232
return e
235233
})

0 commit comments

Comments
 (0)