-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for previews #30
Conversation
Merged master here and added tests. For some reason the wp-graphql-polylang/tests/wpunit/PostPreviewQueryTest.php Lines 25 to 59 in bebf17a
Can you eleborate when it failed before? |
Oh wait. Now it fails in the CI 🤔 |
Are you sure that Polylang is setting the language of the preview post? After creating preview, the newly created revision does not seem get the term relationship to the
If you go and check the post id of the revision, and set the language via |
It is explicitly set here in the test: But I'll test this in a real WP env. Unit testing Polylang correctly is actually quite hard since it's initialization so tied to the normal WP boot up. |
Ah. It seems that in a real WP instance the language of the preview is not set at all so we need to fallback to the language of the original post. |
@esamattis Great, thank you! |
Returns languages and translations when querying post previews.