Opened 9 years ago
Closed 8 months ago
#42089 closed enhancement (maybelater)
Function to detect if current page is a preview of a draft
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Posts, Post Types | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
It would be very helpful if there was a function to detect if the page being viewed is a preview of a draft. Call this is_draft_preview().
Currently, you can achieve this check with code like this:
<?php function is_draft_preview() { global $post; $is_draft = 'draft' === $post->post_status; return ( is_preview() && $is_draft ); }
Change History (3)
This ticket was mentioned in Slack in #core by sirlouen. View the logs.
8 months ago
Note: See
TracTickets for help on using
tickets.
This seems to be pretty much the same as #42088 and the same answer but using
draftfor the$post_status.Same conclusion, time to close it as
maybelater, but again I doubt this should ever be added.