Opened 11 years ago
Closed 10 years ago
#24139 closed defect (bug) (fixed)
Don't show "Preview" for locked, non-public post types
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | minor | Version: | 3.6 |
Component: | Posts, Post Types | Keywords: | has-patch needs-testing commit |
Focuses: | Cc: |
Description
If a post_type is not public but has show_ui => true
, we shouldn't show the preview link on the "This content is currently locked" notice.
Attachments (1)
Change History (11)
#4
@
10 years ago
It looks like we show a preview link in the update notice in this same situation (public=>false, show_ui=>true), but it 404s.
#5
@
10 years ago
Regarding my previous comment, it looks like you can use the post_updated_messages
filter to add your own custom updated messages for your post types. I think this is sufficient for someone to remove the preview link if they want. If we wanted to handle this automatically we could, but it didn't seem as necessary there.
It also looks like this should be based on publicly_queryable
not public
. 24139.diff does just that. It hides the preview button by default if the post type is not publicly_queryable
. I also leaves in the preview_post_link
filter even for those post types, so you could override this if you wanted by using that filter to return a preview URL.
The 'Go back' button needs fixing too. There may not be a referer if you've gone directly to the editing screen or opened it in a new tab, and the referer may be the same as the current page in the case where you've previously made a save and someone has just taken over.