-
Notifications
You must be signed in to change notification settings - Fork 16
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 of custom post type doesn't show subtitle #36
Comments
If you are able to prepare a PR that would be very welcome. Thank you |
I'm currently running some tests and in my case both Everything runs smoothly when I remove the whole |
It was originally added by a contributor in this commit to support revisions: It was then reworking in this commit: I think it may relate to browsing revisions of a page rather that previewing the page (?) |
I was able to narrow down the bug: If a draft post has revisions the subtitle is missing in the preview. If there are no revisions (no changes saved in draft mode) the subtitle displays correctly in the preview. So in the current logic if a post has a revision the latest revision is pulled correctly but it has no subtitle meta data. Could be that it's not saved correctly. I also guess that the problem occurs in custom post types that do not support revisions at all. In general the nested logic in the function is a little bit confusing since the preview of a post is not nessacarrily related to post revisions. As another observation I could not get |
When previewing a custom post type post (via the preview link on the edit post screen) the subtitle doesn't appear.
Looking at the code of
includes/subtitle.php
(Link) you're checking for apreview_id
GET parameter.It seems that this parameter is not present in custom post types where the URL looks like
https://example.com?post_type={custom_post_type}&p={post_id}&preview=true
.I can prepare a PR if required.
The text was updated successfully, but these errors were encountered: