-
Notifications
You must be signed in to change notification settings - Fork 129
#931 - Previews on CPT #954
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/webdevstudios/nextjs-wordpress-starter/AWpSZGyEU6As2ikTrKmTqVrSTXG7 |
9041435
to
a7f9e01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial things. I will test this more in-depth throughout the day.
@@ -29,6 +29,7 @@ export default function Archive({ | |||
taxonomy, | |||
term | |||
}) { | |||
// console.log('ARCHIVE') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnrobertmcc Please remove all the console.log()
comments
@@ -61,7 +61,7 @@ export default async function getPostTypeStaticProps( | |||
} | |||
} | |||
|
|||
/* -- Handle dynamic archive display. -- */ | |||
// /* -- Handle dynamic archive display. -- */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnrobertmcc Please fix this comment syntax.
…evStudios/nextjs-wordpress-starter into hotfix/931-CPT-previews-not-working
…ter into hotfix/931-CPT-previews-not-working
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Closes #931
Note
This solves the routing problem of previews not being generated, but it does not solve the problem of the 'preview button' being broken. I have opened an issue here.
Description
CPT Previews were not viewable due to missing logic in building the Apollo Query.
Verification
How will a stakeholder test this?
git checkout hotfix/931-CPT-previews-not-working
Create new CPT in WP Admin
In CPT Ui, ensure
show in GraphQL
is set to true for new CPT.Click on preview of CPT, it should redirect to
/preview/${databaseId}/
with a working preview.NOTE: As mentieond above, the 'preview in new tab' button does not work on CPT, it will redirect to home page. Please use 'preview' button in quick edit on pagination of CPT.
Ensure regular post type previews are working as well.