-
Notifications
You must be signed in to change notification settings - Fork 3
Default Author breaks permalink preview #8
Comments
Thanks for commenting. I just tested with 4.8 RC and I can verify what you describe. I think it might be related how/when the status is changed from auto-draft to draft, When the draft is saved, then it works as expected. I just spent 2 hours tracing this in the core, but without result, ;-) |
:) Thanks for looking into this. What I’ve also noticed is that the actual preview link breaks, too. As soon as Default Author is disabled, they work again. |
This is the preivew url for our own posts:
and it's now with the draft post status When we change the post author with the wp_insert_post_data filter, then the preview url becomes like:
and the post status is still auto-draft and that means a different behaviour of WP_Query where there's a check if the status object is protected (or private) else the posts array is cleared: The draft post status is registered as protected, but the auto-draft status is registered as internal and not explicitly as protected or private. So the posts array is cleared in the latter case (what we're experiencing here too). So I think if we understand when/how the auto-draft is changed to draft, we might be closer solving it ;-) |
I finally found the code that's responsible, inside the namely this check
or actually this part of it
where the current user id has to match the post author. so that seems to cover the why part ;-) |
(Observed in WordPress 4.7.5:) With Default Author activated and then writing a new post, the permalink preview stops working correctly.
The standard behavior is: User begins new post, as soon as title is in the preview for the post permalink appears; it matches what has been defined in the Permalinks settings and is editable.
As soon as Default author is enabled, this behavior stops: User begins new post, preview for the pot permalink appears, but it matches the fallback ?p=n format, and is not editable.
Have others observed this, too? Any easy fix? (I had a quick look at the code but didn’t spot anything glaring.)
The text was updated successfully, but these errors were encountered: