Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview not working for CPT in draft #1920

Open
1 task done
MKlblangenois opened this issue Jul 8, 2024 · 1 comment
Open
1 task done

Preview not working for CPT in draft #1920

MKlblangenois opened this issue Jul 8, 2024 · 1 comment

Comments

@MKlblangenois
Copy link

Description

When I try to reach the preview page of a CPT in draft, I got the following error: The URL must contain the proper "previewPathname" query param for previews..

The URL returned from WP preview button when page isn't published: http://localhost:3000/preview?post_type=recrutement&p=20766&preview=true&_thumbnail_id=328

image

Steps to reproduce

  1. Create a new CPT (following the Faust doc)
  2. Go to WordPress back-office and add a new page for the new CPT
  3. Try to preview the link without publishing the page

Additional context

An issue was already opened in the past for a similar issue and get closed due to 2 PR's that was normally fix the issue: #1561

@faustwp/core Version

3.0.3

@faustwp/cli Version

3.0.2

FaustWP Plugin Version

1.3.2

WordPress Version

6.5.4

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes
@floretsky
Copy link

Hi!

I am experiencing the same issue.
When a post of Custom Post Type has a status of "Draft," the preview link is missing essential arguments (appended in the preview_post_link hook located in faustwp/includes/replacement/callbacks.php:137), causing Faust to fail in generating a preview.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants