-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #866 from frontity/fix/child-pages-same-slug
Check for all returned posts in the post type handler instead of just the first one
- Loading branch information
Showing
5 changed files
with
189 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@frontity/wp-source": patch | ||
--- | ||
|
||
Fix a bug where frontity could not fetch a page or child page with the same slug as the parent/child. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ce/src/libraries/handlers/__tests__/mocks/post-type/child-page-with-parent-same-slug.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[ | ||
{ | ||
"id": 2, | ||
"slug": "page-1", | ||
"type": "page", | ||
"link": "https://test.frontity.org/page-1/", | ||
"author": 1, | ||
"parent": 0, | ||
"featured_media": 1, | ||
"_embedded": { | ||
"author": [ | ||
{ | ||
"id": 1, | ||
"name": "Author 1", | ||
"link": "https://test.frontity.org/author/author-1/", | ||
"slug": "author-1" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": 1, | ||
"slug": "page-1", | ||
"type": "page", | ||
"link": "https://test.frontity.org/parent/page-1/", | ||
"author": 1, | ||
"parent": 2, | ||
"featured_media": 1, | ||
"_embedded": { | ||
"author": [ | ||
{ | ||
"id": 1, | ||
"name": "Author 1", | ||
"link": "https://test.frontity.org/author/author-1/", | ||
"slug": "author-1" | ||
} | ||
], | ||
"up": [ | ||
{ | ||
"id": 2, | ||
"link": "https://test.frontity.org/parent/", | ||
"slug": "parent" | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters